auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testTenantContextLoadInLogin() throws LazyLoadingTestException { assertEquals(getTenantStatus(TENANT_DOMAIN_1).isTenantContextLoaded(), false, "Tenant context is loaded before any action related to that tenant"); assertEquals(getTenantStatus(TENANT_DOMAIN_2).isTenantContextLoaded(), false, "Tenant context is loaded before any action related to that tenant"); log.info("Testing Tenant context loading for :" + TENANT_DOMAIN_1); loginAsTenantAdmin(TENANT_DOMAIN_1_kEY); try { webAppAdminClient = new WebAppAdminClient(backendURL, sessionCookie); } catch (AxisFault axisFault) { String customErrorMessage = "AxisFault Exception when creating WebAppAdminClient object, Backend URL:" + backendURL + " Session Cookie: " + sessionCookie + "\n" + axisFault.getMessage(); <START> log.error(customErrorMessage); <END> throw new LazyLoadingTestException(customErrorMessage, axisFault); } assertEquals(getTenantStatus(TENANT_DOMAIN_1).isTenantContextLoaded(), true, "Tenant context is not loaded after tenant loginTenantUser"); assertEquals(getTenantStatus(TENANT_DOMAIN_2).isTenantContextLoaded(), false, "Tenant context is loaded without" + " loginTenantUser"); }</code><technical_language>log axis2 fault custom error message. log.error(customErrorMessage, axisFault);</technical_language>

Target:
public void testTenantContextLoadInLogin() throws Exception { assertFalse(getTenantStatus(tenantDomain1).isTenantContextLoaded(), "Tenant context is loaded before any action related to that tenant"); assertFalse(getTenantStatus(tenantDomain2).isTenantContextLoaded(), "Tenant context is loaded before any action related to that tenant"); log.info("Testing Tenant context loading for :" + tenantDomain1); init(TENANT_DOMAIN_1_KEY, ADMIN); try { webAppAdminClient = new WebAppAdminClient(backendURL, sessionCookie); } catch (AxisFault axisFault) { String customErrorMessage = "AxisFault Exception when creating WebAppAdminClient object, Backend URL:" + backendURL + " Session Cookie: " + sessionCookie + "\n" + axisFault.getMessage(); log.error(customErrorMessage, axisFault); throw new LazyLoadingTestException(customErrorMessage, axisFault); } assertTrue(getTenantStatus(tenantDomain1).isTenantContextLoaded(), "Tenant context is not loaded after tenant loginTenantUser"); assertFalse(getTenantStatus(tenantDomain2).isTenantContextLoaded(), "Tenant context is loaded without" + " loginTenantUser"); }
Source:
<code>void testSimple() { final Territory westRussia = gameData.getMap().getTerritory("West Russia"); final IBattle battle = mock(IBattle.class); final GamePlayer russians = GameDataTestUtil.russians(gameData); final IDelegateBridge bridge = newDelegateBridge(russians); final UnitType infantryType = GameDataTestUtil.infantry(gameData); final List<Unit> infantry = infantryType.create(1, russians); final Collection<TerritoryEffect> territoryEffects = TerritoryEffectHelper.getEffects(westRussia); whenGetRandom(bridge) .thenAnswer(withValues(1)) .thenAnswer(withValues(2)) .thenAnswer(withValues(0)) .thenAnswer(withValues(1)); final DiceRoll roll = DiceRoll.rollDice( infantry, true, russians, bridge, battle, "", territoryEffects, null, infantry); assertThat(roll.getHits(), is(1)); final DiceRoll roll2 = DiceRoll.rollDice( infantry, true, russians, bridge, battle, "", territoryEffects, null, infantry); assertThat(roll2.getHits(), is(0)); final DiceRoll roll3 = DiceRoll.rollDice( infantry, false, russians, bridge, battle, "", territoryEffects, null, infantry); assertThat(roll3.getHits(), is(1)); final DiceRoll roll4 = <START> DiceRoll.rollDice( <END> infantry, false, russians, bridge, battle, "", territoryEffects, null, infantry); assertThat(roll4.getHits(), is(0)); }</code><technical_language>a method overload cleaner avoid passing null parameter parameter is unused</technical_language>

Target:
void testSimple() { final Territory westRussia = gameData.getMap().getTerritory("West Russia"); final IBattle battle = mock(IBattle.class); final GamePlayer russians = GameDataTestUtil.russians(gameData); final IDelegateBridge bridge = newDelegateBridge(russians); final UnitType infantryType = GameDataTestUtil.infantry(gameData); final List<Unit> infantry = infantryType.create(1, russians); final Collection<TerritoryEffect> territoryEffects = TerritoryEffectHelper.getEffects(westRussia); whenGetRandom(bridge) .thenAnswer(withValues(1)) .thenAnswer(withValues(2)) .thenAnswer(withValues(0)) .thenAnswer(withValues(1)); final DiceRoll roll = DiceRoll.rollDice(infantry, true, russians, bridge, battle, territoryEffects); assertThat(roll.getHits(), is(1)); final DiceRoll roll2 = DiceRoll.rollDice(infantry, true, russians, bridge, battle, territoryEffects); assertThat(roll2.getHits(), is(0)); final DiceRoll roll3 = DiceRoll.rollDice(infantry, false, russians, bridge, battle, territoryEffects); assertThat(roll3.getHits(), is(1)); final DiceRoll roll4 = DiceRoll.rollDice(infantry, false, russians, bridge, battle, territoryEffects); assertThat(roll4.getHits(), is(0)); }
Source:
<code>public byte[] encrypt(final byte[] inputData) { try { final Cipher cipher = Cipher.getInstance(ALGORITHM, PROVIDER); cipher.init(Cipher.ENCRYPT_MODE, this.key, new IvParameterSpec(IVBYTES)); return cipher.doFinal(inputData); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | NoSuchProviderException | InvalidAlgorithmParameterException e) { <START> LOGGER.error("Unexpected exception during encryption", e); <END> throw new EncrypterException("Unexpected exception during encryption!", e); } }</code><technical_language>Replace constant. occurs more once</technical_language>

Target:
public byte[] encrypt(final byte[] inputData) { try { final Cipher cipher = Cipher.getInstance(ALGORITHM, PROVIDER); cipher.init(Cipher.ENCRYPT_MODE, this.key, new IvParameterSpec(IVBYTES)); return cipher.doFinal(inputData); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | NoSuchProviderException | InvalidAlgorithmParameterException e) { LOGGER.error(UNEXPECTED_EXCEPTION_DURING_ENCRYPTION, e); throw new EncrypterException("Unexpected exception during encryption!", e); } }
Source:
<code>private void fillEnemies(SolGame game, RemoveController removeController, ShipConfig enemyConfig, Vector2 chunkCenter) { int enemyCount = getEntityCount(enemyConfig.density); if (enemyCount == 0) { return; } for (int i = 0; i < enemyCount; i++) { Optional<Vector2> enemyPosition = getFreeRndPos(game, chunkCenter); <START> enemyPosition.ifPresent(position -> { <END> FarShip ship = buildSpaceEnemy(game, position, removeController, enemyConfig); game.getObjectManager().addFarObjNow(ship); }); } }</code><technical_language>prefer keeping name of introduced lambda parameter similar (or if compiler allows it) Optional variable name retain context clarity</technical_language>

Target:
private void fillEnemies(SolGame game, RemoveController removeController, ShipConfig enemyConfig, Vector2 chunkCenter) { int enemyCount = getEntityCount(enemyConfig.density); if (enemyCount == 0) { return; } for (int i = 0; i < enemyCount; i++) { Optional<Vector2> enemyPosition = getFreeRndPos(game, chunkCenter); enemyPosition.ifPresent(enemyPos -> { FarShip ship = buildSpaceEnemy(game, enemyPos, removeController, enemyConfig); game.getObjectManager().addFarObjNow(ship); }); } }
Source:
<code>void record(List<Span> sampled, Callback<Void> callback) { <START> if(blockOnStorage) { <END> storage.spanConsumer().accept(sampled).blockingEnqueue(callback); } else { storage.spanConsumer().accept(sampled).enqueue(callback); } }</code><technical_language>I prefer logic handled changing Call api. if spanConsumer.execute() instead in a try/finally exception call callback</technical_language>

Target:
void record(List<Span> sampled, Callback<Void> callback) { if(semaphore != null) { try { semaphore.acquire(); storage.spanConsumer().accept(sampled).execute(); callback.onSuccess(null); } catch (RuntimeException | IOException | InterruptedException e) { callback.onError(e); } finally { semaphore.release(); } } else { storage.spanConsumer().accept(sampled).enqueue(callback); } }
Source:
<code>private void finishAllThreads(Collection<Future<Void>> results) throws Throwable { for (final Future<Void> result : results) { try { result.get(); <START> } catch (final ExecutionException e) { <END> throw e.getCause(); } } }</code><technical_language>this is a part of original method anymore, more sense unwrap original exception in order lose trace leading executor thread this finishAllThreads method. I original attempt stack trace shorter potential of reducing clarity improving (in other words, I a stupid originally)</technical_language>

Target:
private static void finishAllThreads(Collection<Future<Void>> results) throws InterruptedException, ExecutionException { for (final Future<Void> result : results) { result.get(); } }
Source:
<code>public void testGetCommandLineNonNullModSeqWithFlagDraftTypeShared() throws IOException, IllegalArgumentException, IllegalAccessException, SearchException, ImapAsyncClientException { final Flags flags = new Flags(); <START> flags.add(Flags.Flag.DRAFT); <END> final ExtendedModifiedSinceTerm extendedModifiedSinceTerm = new ExtendedModifiedSinceTerm(flags, EntryTypeReq.SHARED, 1L); final MessageNumberSet[] msgsets = null; final ImapRequest cmd = new SearchCommand(msgsets, extendedModifiedSinceTerm, null); Assert.assertEquals(cmd.getCommandLine(), "SEARCH MODSEQ \"/flags/\\\\Draft\" SHARED 1\r\n", "Expected result mismatched."); cmd.cleanup(); for (final Field field : fieldsToCheck) { Assert.assertNull(field.get(cmd), "Cleanup should set " + field.getName() + " as null"); } }</code><technical_language>Add cases cover combinatios of other SearchTerms ExtendedModifiedSinceTerm</technical_language>

Target:
public void testGetCommandLineNonNullModSeqWithFlagDraftTypeShared() throws IOException, IllegalArgumentException, IllegalAccessException, SearchException, ImapAsyncClientException { final Flags flags = new Flags(); flags.add(Flags.Flag.DRAFT); final ExtendedModifiedSinceTerm extendedModifiedSinceTerm = new ExtendedModifiedSinceTerm(flags, EntryTypeRequest.SHARED, 1L); final MessageNumberSet[] msgsets = null; final ImapRequest cmd = new SearchCommand(msgsets, extendedModifiedSinceTerm, null); Assert.assertEquals(cmd.getCommandLine(), "SEARCH MODSEQ \"/flags/\\\\Draft\" SHARED 1\r\n", "getCommandLine() mismatched."); cmd.cleanup(); for (final Field field : fieldsToCheck) { Assert.assertNull(field.get(cmd), "Cleanup should set " + field.getName() + " as null"); } }
Source:
<code>private String deleteBucket() throws SignatureException, SSLSetupException, CommandException, IOException { try { getClient().deleteBucket(new DeleteBucketRequest(bucketName)); } catch (final FailedRequestException e) { if (e.getStatusCode() == 409) { <START> return "Error: Tried to delete a non-empty bucket without the force delete objects flag.\nUse --force to delete all objects in the bucket"; <END> } throw new CommandException("Error: Request failed with the following error: " + e.getMessage(), e); } return "Success: Deleted bucket '" + bucketName + "'."; }</code><technical_language>This return a command exception</technical_language>

Target:
private String deleteBucket() throws SignatureException, SSLSetupException, CommandException, IOException { try { getClient().deleteBucket(new DeleteBucketRequest(bucketName)); } catch (final FailedRequestException e) { if (e.getStatusCode() == 409) { throw new CommandException("Error: Tried to delete a non-empty bucket without the force delete objects flag.\nUse --force to delete all objects in the bucket"); } throw new CommandException("Error: Request failed with the following error: " + e.getMessage(), e); } return "Success: Deleted bucket '" + bucketName + "'."; }
Source:
<code>public EntityManager createEntityManager(SynchronizationType synchronizationType) { <START> return null; <END> }</code><technical_language>here. throw new UnsupportedOperationException</technical_language>

Target:
public EntityManager createEntityManager(SynchronizationType synchronizationType) { throw new UnsupportedOperationException("createEntityManager"); }
Source:
<code>public static void main(String[] args) { ArrayTransposeMasterWorker mw = new ArrayTransposeMasterWorker(); int rows = 10; int columns = 20; int[][] inputMatrix = new int[rows][columns]; Random rand = new Random(); for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { inputMatrix[i][j] = rand.nextInt(10); <START> } <END> } ArrayInput input = new ArrayInput(inputMatrix); ArrayResult result = (ArrayResult) mw.getResult(input); if (result != null) { App.printMatrix(inputMatrix); System.out.println(""); App.printMatrix(result.data); } else { System.out.println("Please enter non-zero input"); } }</code><technical_language>Creating input matrix extracted utility method</technical_language>

Target:
public static void main(String[] args) { ArrayTransposeMasterWorker mw = new ArrayTransposeMasterWorker(); int rows = 10; int columns = 20; int[][] inputMatrix = ArrayUtilityMethods.createRandomIntMatrix(rows,columns); ArrayInput input = new ArrayInput(inputMatrix); ArrayResult result = (ArrayResult) mw.getResult(input); if (result != null) { ArrayUtilityMethods.printMatrix(inputMatrix); System.out.println(""); ArrayUtilityMethods.printMatrix(result.data); } else { System.out.println("Please enter non-zero input"); } }
Source:
<code>private SurveyAssignment marshallToDomain(SurveyAssignmentDto dto) { final SurveyAssignment sa = new SurveyAssignment(); BeanUtils.copyProperties(dto, sa); <START> sa.setKey(KeyFactory.createKey("SurveyAssignment", dto.getKeyId())); <END> sa.setDeviceIds(dto.getDevices()); sa.setSurveyIds(dto.getSurveys()); return sa; }</code><technical_language>set key keyId != null</technical_language>

Target:
private SurveyAssignment marshallToDomain(SurveyAssignmentDto dto) { final SurveyAssignment sa = new SurveyAssignment(); BeanUtils.copyProperties(dto, sa); if (dto.getKeyId() != null) { sa.setKey(KeyFactory.createKey("SurveyAssignment", dto.getKeyId())); } sa.setDeviceIds(dto.getDevices()); sa.setSurveyIds(dto.getSurveys()); return sa; }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionSubjects = new ArrayList<>(); permissionSubjects.add(new PermissionSubject( <START> getDiskImage().getId(), VdcObjectType.Disk, ActionGroup.ATTACH_DISK)); <END> return permissionSubjects; }</code><technical_language>permissions write glance domain</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionSubjects = new ArrayList<>(); permissionSubjects.add(new PermissionSubject(getDiskImage().getId(), VdcObjectType.Disk, ActionGroup.ATTACH_DISK)); permissionSubjects.add(new PermissionSubject(getParameters().getStorageDomainId(), VdcObjectType.Storage, ActionGroup.CREATE_DISK)); return permissionSubjects; }
Source:
<code>public String toString() { <START> return "ThreadMeta{threadId=" + threadId + ", threadName=" + threadName + '}'; <END> }</code><technical_language>whitespace/style</technical_language>

Target:
public String toString() { return "ThreadMeta{" + "threadId=" + threadId + ", threadName=" + threadName + '}'; }
Source:
<code>public void add(String str, StatsSnapshot statsSnapshot) { <START> this.subMap = this.subMap == null ? new HashMap<>() : this.subMap; <END> this.subMap.put(str, statsSnapshot); }</code><technical_language>minor: need this. in lines</technical_language>

Target:
public void add(String str, StatsSnapshot statsSnapshot) { subMap = subMap == null ? new HashMap<>() : subMap; subMap.put(str, statsSnapshot); }
Source:
<code>public void run() { while(alive) { try { Thread.sleep(SLEEP_TIME); try { storageClientManager.getMetricsDAO().checkLiveness(RHQ_KEYSPACE); if(fails > 0) { fails = 0; } } catch(QueryTimeoutException e) { LOG.error("Storage node connection check timed out"); } catch(NoHostAvailableException e) { fails++; if(fails >= ALLOWED_FAILS) { LOG.error("Failed to contact the storage node for live check, recreating connection session"); storageClientManager.refreshSession(); Thread.sleep(EXTENDED_SLEEP); } } } catch (InterruptedException e) { <START> } <END> } }</code><technical_language>I inclined add another catch block for Exception possibly Throwable. If a RuntimeException is thrown for example, SessionAliveChecker thread die silently</technical_language>

Target:
public void run() { while(alive) { try { Thread.sleep(SLEEP_TIME); try { storageClientManager.getMetricsDAO().checkLiveness(RHQ_KEYSPACE); if(fails > 0) { fails = 0; } } catch(QueryTimeoutException e) { LOG.error("Storage node connection check timed out"); } catch(NoHostAvailableException e) { fails++; if(fails >= ALLOWED_FAILS) { LOG.error("Failed to contact the storage node for live check, recreating connection session"); storageClientManager.refreshSession(); Thread.sleep(EXTENDED_SLEEP); } } } catch (InterruptedException e) { } catch(Exception e) { LOG.error("AliveCheck thread run into an unexpected exception: " + e.getLocalizedMessage()); } } }
Source:
<code>public void signTransaction(Transaction tx, Transaction.SigHash hashType, @Nullable KeyParameter aesKey) { lock.lock(); try { List<TransactionInput> inputs = tx.getInputs(); List<TransactionOutput> outputs = tx.getOutputs(); checkState(inputs.size() > 0); checkState(outputs.size() > 0); checkArgument(hashType == Transaction.SigHash.ALL, "Only SIGHASH_ALL is currently supported"); for (TransactionSigner signer : signers) { try { log.debug("Trying out to sign tx."); signer.signInputs(tx, aesKey); <START> } catch (IllegalArgumentException e) { <END> } catch (IllegalStateException e) { } } } finally { lock.unlock(); } }</code><technical_language>Yeah, I agree explicit exception type here, KeyNotFoundException (I is similar this)</technical_language>

Target:
public void signTransaction(Transaction tx, Transaction.SigHash hashType, @Nullable KeyParameter aesKey) { lock.lock(); try { List<TransactionInput> inputs = tx.getInputs(); List<TransactionOutput> outputs = tx.getOutputs(); checkState(inputs.size() > 0); checkState(outputs.size() > 0); checkArgument(hashType == Transaction.SigHash.ALL, "Only SIGHASH_ALL is currently supported"); KeyBag maybeDecryptingKeyBag = aesKey != null ? new DecryptingKeyBag(this, aesKey) : this; for (TransactionSigner signer : signers) { if (!signer.signInputs(tx, maybeDecryptingKeyBag)) log.info("{} returned false for the tx", signer.getClass().getName()); } } finally { lock.unlock(); } }
Source:
<code>public void testListSLATimer() throws Exception { processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "UserTaskWithSLAOnTask"); assertNotNull(processInstanceId); <START> long scheduleTime = System.currentTimeMillis(); <END> Collection<NodeInstanceDesc> activeNodes = processAdminService.getActiveNodeInstances(processInstanceId); assertNotNull(activeNodes); assertEquals(1, activeNodes.size()); Collection<TimerInstance> timers = processAdminService.getTimerInstances(processInstanceId); assertNotNull(timers); assertEquals(1, timers.size()); TimerInstance timer = timers.iterator().next(); assertNotNull(timer.getActivationTime()); assertNotNull(timer.getDelay()); assertNotNull(timer.getNextFireTime()); assertNotNull(timer.getProcessInstanceId()); assertNotNull(timer.getSessionId()); assertNotNull(timer.getTimerId()); assertNotNull(timer.getId()); assertNotNull(timer.getTimerName()); }</code><technical_language>This is</technical_language>

Target:
public void testListSLATimer() throws Exception { processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "UserTaskWithSLAOnTask"); assertNotNull(processInstanceId); Collection<NodeInstanceDesc> activeNodes = processAdminService.getActiveNodeInstances(processInstanceId); assertNotNull(activeNodes); assertEquals(1, activeNodes.size()); Collection<TimerInstance> timers = processAdminService.getTimerInstances(processInstanceId); assertNotNull(timers); assertEquals(1, timers.size()); TimerInstance timer = timers.iterator().next(); assertNotNull(timer.getActivationTime()); assertNotNull(timer.getDelay()); assertNotNull(timer.getNextFireTime()); assertNotNull(timer.getProcessInstanceId()); assertNotNull(timer.getSessionId()); assertNotNull(timer.getTimerId()); assertNotNull(timer.getId()); assertNotNull(timer.getTimerName()); }
Source:
<code>private void handleConnectionException(ConnectionException connectionException, ConnectionSupplier connectionSupplier) { Optional<String> exceptionConfigName = executionContext.getConfiguration().map(config -> ((ConfigurationInstance) config).getName()); if (isTransactional()) { <START> connectionException.addInfo("wasTransactional", true); <END> } if (isFirstPage) { exceptionConfigName.ifPresent(name -> connectionException.addInfo("operationConfigName", name)); } connectionSupplier.invalidateConnection(); }</code><technical_language>Define constant in org.mule.runtime.module.extension.internal.ExtensionProperties. key start proper prefix</technical_language>

Target:
private void handleConnectionException(ConnectionException connectionException, ConnectionSupplier connectionSupplier) { Optional<String> exceptionConfigName = executionContext.getConfiguration().map(config -> ((ConfigurationInstance) config).getName()); if (isPartOfActiveTransaction(config)) { connectionException.addInfo(IS_TRANSACTIONAL, true); } exceptionConfigName.ifPresent(name -> connectionException.addInfo(COMPONENT_CONFIG_NAME, name)); connectionSupplier.invalidateConnection(); }
Source:
<code>private Ref resolve(Ref ref, int depth) throws IOException { if (!ref.isSymbolic()) { return ref; } Ref dst = ref.getTarget(); if (MAX_SYMBOLIC_REF_DEPTH <= depth) { return null; } dst = exactRef(dst.getName()); if (dst == null) { return ref; } dst = resolve(dst, depth + 1); if (dst == null) { return null; } <START> return new VersionedRef(new SymbolicRef(ref.getName(), dst), <END> ref.getUpdateIndex()); }</code><technical_language>If getLeaf() this, return unversioned ref</technical_language>

Target:
private Ref resolve(Ref ref, int depth) throws IOException { if (!ref.isSymbolic()) { return ref; } Ref dst = ref.getTarget(); if (MAX_SYMBOLIC_REF_DEPTH <= depth) { return null; } dst = exactRef(dst.getName()); if (dst == null) { return ref; } dst = resolve(dst, depth + 1); if (dst == null) { return null; } return new SymbolicRef(ref.getName(), dst, ref.getUpdateIndex()); }
Source:
<code>public void offlineDownloadValidEmailTest() throws Exception { when(authService.getUserDetails("test@test.com")) .thenReturn((Map)ImmutableMap.of( <START> "locked", false, <END> "roles", Arrays.asList("ROLE_USER") )); this.mockMvc.perform(get("/occurrences/offline/download*") .param("reasonTypeId", "10") .param("email", "test@test.com")) .andExpect(status().isOk()) .andExpect(content().contentType("application/json;charset=UTF-8")); verify(authService).getUserDetails("test@test.com"); }</code><technical_language>error for this changed 403 500, test is failing: [ERROR] Failures: [ERROR] DownloadControllerTest.offlineDownloadValidEmailTest:87 Status expected:<200> was:<500></technical_language>

Target:
public void offlineDownloadValidEmailTest() throws Exception { when(authService.getUserDetails("test@test.com")) .thenReturn((Map)ImmutableMap.of( "activated", true, "locked", false, "roles", Arrays.asList("ROLE_USER") )); this.mockMvc.perform(get("/occurrences/offline/download*") .param("reasonTypeId", "10") .param("email", "test@test.com")) .andExpect(status().isOk()) .andExpect(content().contentType("application/json;charset=UTF-8")); verify(authService).getUserDetails("test@test.com"); }
Source:
<code>public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) { if (_results == null) { _results = new double[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } byte[][] values = _transformFunction.transformToBytesValuesSV(projectionBlock); <START> Geometry geometry; for (int i = 0; i < projectionBlock.getNumDocs(); i++) { geometry = GeometrySerializer.deserialize(values[i]); <END> _results[i] = GeometryUtils.isGeography(geometry) ? calculateGeographyArea(geometry) : geometry.getArea(); } return _results; }</code><technical_language>(nit) Cache numDocs, for other classes suggestion int numDocs = projectionBlock.getNumDocs(); for (int i = 0; i < numDocs; i++) { Geometry geometry = GeometrySerializer.deserialize(values[i]);</technical_language>

Target:
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) { if (_results == null) { _results = new double[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } byte[][] values = _transformFunction.transformToBytesValuesSV(projectionBlock); int numDocs = projectionBlock.getNumDocs(); for (int i = 0; i < numDocs; i++) { Geometry geometry = GeometrySerializer.deserialize(values[i]); _results[i] = GeometryUtils.isGeography(geometry) ? calculateGeographyArea(geometry) : geometry.getArea(); } return _results; }
Source:
<code>public static Result create() { DynamicForm dynamicForm = Application.dynamicForm.bindFromRequest(request()); Record record = createRecordFromParams(dynamicForm.data()); List<ValError> validationErrors = new Validator(Register.instance.registerInfo().keys).validate(record); if (validationErrors.isEmpty()) { try { Register.instance.store().save(record); <START> return redirect("/hash/" + record.getHash()); <END> } catch (DatabaseException e) { dynamicForm.reject(e.getMessage()); return ok(views.html.newEntry.render(Register.instance.registerInfo().keys, dynamicForm)); } } validationErrors.stream().forEach(error -> dynamicForm.reject(error.key, "error.required")); return ok(views.html.newEntry.render(Register.instance.registerInfo().keys, dynamicForm)); }</code><technical_language>Please play reverse routing: <LINK_0></technical_language>

Target:
public static Result create() { DynamicForm dynamicForm = Application.dynamicForm.bindFromRequest(request()); Record record = createRecordFromParams(dynamicForm.data()); List<ValidationError> validationErrors = new Validator(Register.instance.registerInfo().keys).validate(record); if (validationErrors.isEmpty()) { try { Register.instance.store().save(record); return redirect(controllers.api.routes.Rest.findByHash(record.getHash())); } catch (DatabaseException e) { dynamicForm.reject(e.getMessage()); return ok(views.html.newEntry.render(Register.instance.registerInfo().keys, dynamicForm)); } } validationErrors.stream().forEach(error -> dynamicForm.reject(error.key, "error.required")); return ok(views.html.newEntry.render(Register.instance.registerInfo().keys, dynamicForm)); }
Source:
<code>private void <START> asignChangeOwnerPermissions(Repository <END> git) throws IOException, ConfigInvalidException{ MetaDataUpdate md = new MetaDataUpdate( GitReferenceUpdated.DISABLED, allProjects, git); md.getCommitBuilder().setAuthor(serverUser); md.getCommitBuilder().setCommitter(serverUser); md.setMessage("Assign Change Owner to All-Projects permissions"); ProjectConfig config = ProjectConfig.read(md); AccessSection heads = config.getAccessSection(AccessSection.HEADS, true); grant(config, heads, Permission.ABANDON, changeOwner); grant(config, heads, Permission.EDIT_TOPIC_NAME, true, changeOwner); grant(config, heads, Permission.DELETE_DRAFTS, changeOwner); grant(config, heads, Permission.PUBLISH_DRAFTS, changeOwner); grant(config, heads, Permission.REBASE, changeOwner); grant(config, heads, Permission.REMOVE_REVIEWER, changeOwner); grant(config, heads, Permission.VIEW_DRAFTS, changeOwner); config.commit(md); }</code><technical_language>assign</technical_language>

Target:
private void asignChangeOwnerPermissions(Repository git) throws IOException, ConfigInvalidException{ MetaDataUpdate md = new MetaDataUpdate( GitReferenceUpdated.DISABLED, allProjects, git); md.getCommitBuilder().setAuthor(serverUser); md.getCommitBuilder().setCommitter(serverUser); md.setMessage("Assign Change Owner to All-Projects permissions"); ProjectConfig config = ProjectConfig.read(md); AccessSection all = config.getAccessSection(AccessSection.ALL, true); grant(config, all, Permission.ABANDON, changeOwner); grant(config, all, Permission.EDIT_TOPIC_NAME, true, changeOwner); grant(config, all, Permission.DELETE_DRAFTS, changeOwner); grant(config, all, Permission.PUBLISH_DRAFTS, changeOwner); grant(config, all, Permission.REBASE, changeOwner); grant(config, all, Permission.REMOVE_REVIEWER, changeOwner); grant(config, all, Permission.VIEW_DRAFTS, changeOwner); config.commit(md); }
Source:
<code>public void tearDown() throws Exception { if (TransactionHelper.isTransactionActiveOrMarkedRollback()) { TransactionHelper.setTransactionRollbackOnly(); TransactionHelper.commitOrRollbackTransaction(); } Framework.getRuntime().getComponentManager().reset(); <START> Framework.getRuntime().getComponentManager().start(); <END> }</code><technical_language>WorkManager needs fully stopped if want clean queues hold metrics. Here, need restart component Manager in @After step. need reset it. create feature, put this restart in beforeMethodRun + commit/start transaction logic</technical_language>

Target:
public void tearDown() throws Exception { if (TransactionHelper.isTransactionActiveOrMarkedRollback()) { TransactionHelper.setTransactionRollbackOnly(); TransactionHelper.commitOrRollbackTransaction(); } }
Source:
<code>public OperationFuture<List<FirewallPolicy>> update( FirewallPolicyFilter firewallPolicyFilter, FirewallPolicyConfig config ) { <START> checkNotNull(firewallPolicyFilter, "Load balancer filter must be not null"); <END> List<FirewallPolicy> firewallPolicyList = findLazy(firewallPolicyFilter) .map(metadata -> FirewallPolicy.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId()) )) .collect(toList()); return update(firewallPolicyList, config); }</code><technical_language>Please change assert message filter name</technical_language>

Target:
public OperationFuture<List<FirewallPolicy>> update( FirewallPolicyFilter firewallPolicyFilter, FirewallPolicyConfig config ) { checkNotNull(firewallPolicyFilter, "Firewall policy filter must be not null"); List<FirewallPolicy> firewallPolicyList = findLazy(firewallPolicyFilter) .map(metadata -> FirewallPolicy.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId()) )) .collect(toList()); return update(firewallPolicyList, config); }
Source:
<code>public void callOnRequestPermissionsResultDetectorNoErrorForKotlin() throws Exception { @Language("JAVA") String runtimePerms = getRuntimePermission(); @Language("JAVA") String onNeeds = getOnNeedsPermission(); @Language("JAVA") String onShow = getOnRationaleAnnotation(); @Language("kotlin") String foo = "" + "package permissions.dispatcher;\n" + "@RuntimePermissions\n" + "class Foo : android.app.Activity {\n" + "fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {\n" <START> + "super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n" <END> + "onRequestPermissionsResult(requestCode, grantResults);\n" + "}\n" + "@NeedsPermission(\"Camera\")" + "fun showCamera() {" + "}\n" + "@OnShowRationale(\"Camera\")" + "fun someMethod() {" + "}\n" + "}"; @Language("kotlin") String generatedClass = "" + "package permissions.dispatcher;\n" + "fun Foo.onRequestPermissionsResult(requestCode: Int, grantResults: IntArray) {" + "}"; lint() .files( java("src/permissions/dispatcher/RuntimePermissions.java", runtimePerms), java("src/permissions/dispatcher/NeedsPermission.java", onNeeds), java("src/permissions/dispatcher/OnShowRationale.java", onShow), kt("src/permissions/dispatcher/FooPermissionsDispatcher.kt", generatedClass), kt("src/permissions/dispatcher/Foo.kt", foo)) .issues(CallOnRequestPermissionsResultDetector.ISSUE) .run() .expectClean(); }</code><technical_language>Nit: remove semicolon? line is</technical_language>

Target:
public void callOnRequestPermissionsResultDetectorNoErrorForKotlin() throws Exception { @Language("JAVA") String runtimePerms = getRuntimePermission(); @Language("JAVA") String onNeeds = getOnNeedsPermission(); @Language("JAVA") String onShow = getOnRationaleAnnotation(); @Language("kotlin") String foo = "" + "package permissions.dispatcher\n" + "@RuntimePermissions\n" + "class Foo : android.app.Activity {\n" + "fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {\n" + "super.onRequestPermissionsResult(requestCode, permissions, grantResults)\n" + "onRequestPermissionsResult(requestCode, grantResults)\n" + "}\n" + "@NeedsPermission(\"Camera\")" + "fun showCamera() {" + "}\n" + "@OnShowRationale(\"Camera\")" + "fun someMethod() {" + "}\n" + "}"; @Language("kotlin") String generatedClass = "" + "package permissions.dispatcher\n" + "fun Foo.onRequestPermissionsResult(requestCode: Int, grantResults: IntArray) {" + "}"; lint() .files( java("src/permissions/dispatcher/RuntimePermissions.java", runtimePerms), java("src/permissions/dispatcher/NeedsPermission.java", onNeeds), java("src/permissions/dispatcher/OnShowRationale.java", onShow), kt("src/permissions/dispatcher/FooPermissionsDispatcher.kt", generatedClass), kt("src/permissions/dispatcher/Foo.kt", foo)) .issues(CallOnRequestPermissionsResultDetector.ISSUE) .run() .expectClean(); }
Source:
<code>protected String getShortHelpText(ITmfTrace trace) { <START> return "Analysis module: " + getName() + " for trace " + trace.getName(); END> }</code><technical_language>externalize string</technical_language>

Target:
protected String getShortHelpText(ITmfTrace trace) { return String.format(Messages.TmfAbstractAnalysisModule_AnalysisForTrace, getName(), trace.getName()); }
Source:
<code>public static void deleteEPerson(UUID uuid) throws SQLException, IOException { try (Context c = new Context()) { c.turnOffAuthorisationSystem(); EPerson ePerson = ePersonService.find(c, uuid); if (ePerson != null) { try { ePersonService.delete(c, ePerson); } catch (AuthorizeException e) { <START> throw new RuntimeException(e.getMessage(), e); <END> } } c.complete(); } }</code><technical_language>Tiny mention (just alot in this PR). sorta useless (to me) e.getMessage() here. pass in a more specific error message, do throw new RuntimeException(e);</technical_language>

Target:
public static void deleteEPerson(UUID uuid) throws SQLException, IOException { try (Context c = new Context()) { c.turnOffAuthorisationSystem(); EPerson ePerson = ePersonService.find(c, uuid); if (ePerson != null) { try { ePersonService.delete(c, ePerson); } catch (AuthorizeException e) { throw new RuntimeException(e); } } c.complete(); } }
Source:
<code>public void run() throws Exception { if (this.seconds == null) { throw new RuntimeException("Seconds not set"); } final int sec = Integer.parseInt(this.seconds); System.out.println("Sec " + sec); synchronized (this) { try { <START> this.wait(sec * 1000 + 1); <END> } catch (final InterruptedException e) { System.out.println("Interrupted " + this.fail); } } if (this.fail) { if (this.attempts <= 0 || this.currentAttempt <= this.attempts) { throw new Exception("I failed because I had to."); } } }</code><technical_language>Ping</technical_language>

Target:
public void run() throws Exception { if (this.seconds == null) { throw new RuntimeException("Seconds not set"); } final int sec = Integer.parseInt(this.seconds); System.out.println("Sec " + sec); synchronized (this) { try { if (sec > 0) { this.wait(sec * 1000); } } catch (final InterruptedException e) { System.out.println("Interrupted " + this.fail); } } if (this.fail) { if (this.attempts <= 0 || this.currentAttempt <= this.attempts) { throw new Exception("I failed because I had to."); } } }
Source:
<code>public void onError() { int count = failureCount.incrementAndGet(); if (count >= failureCountThreshold) { if (count == failureCountThreshold) { logger.error("Resource " + resource + " has gone down"); } <START> logger.trace("Adding downtime " + retryBackoffMs + " ms to " + resource); <END> downUntil.set(SystemTime.getInstance().milliseconds() + retryBackoffMs); } }</code><technical_language>trace message be: "{resource} remains in state {time}"</technical_language>

Target:
public void onError() { int count = failureCount.incrementAndGet(); if (count >= failureCountThreshold) { if (count == failureCountThreshold) { logger.error("Resource " + resource + " has gone down"); } logger.trace("Resource " + resource + " remains in down state at time " + SystemTime.getInstance().milliseconds() + "; Adding downtime of " + retryBackoffMs + " ms"); downUntil.set(SystemTime.getInstance().milliseconds() + retryBackoffMs); } }
Source:
<code>public static Neigh buildFrom(ByteBuffer buf) { if (buf == null) return null; if (buf.remaining() < 12) return null; Neigh neigh = new Neigh(); try { neigh.ndm.family = buf.get(); buf.get(); buf.getShort(); neigh.ndm.ifindex = buf.getInt(); neigh.ndm.state = buf.getShort(); neigh.ndm.flags = buf.get(); neigh.ndm.type = buf.get(); } catch (BufferOverflowException ex) { <START> return null; <END> } NetlinkMessage.scanAttributes(buf, neigh); return neigh; }</code><technical_language>a buffer overflow if checked buf.remaining</technical_language>

Target:
public static Neigh buildFrom(ByteBuffer buf) { if (buf == null) return null; if (buf.remaining() < 12) return null; Neigh neigh = new Neigh(); try { neigh.ndm.family = buf.get(); buf.get(); buf.getShort(); neigh.ndm.ifindex = buf.getInt(); neigh.ndm.state = buf.getShort(); neigh.ndm.flags = buf.get(); neigh.ndm.type = buf.get(); } catch (BufferUnderflowException ex) { return null; } NetlinkMessage.scanAttributes(buf, neigh); return neigh; }
Source:
<code>private MustFightBattle givenFirstStrikeBattleSetup( final boolean attackerDestroyer, final boolean defenderDestroyer, final boolean ww2v2, final boolean defendingSubsSneakAttack) { final MustFightBattle battle = spy(newBattle(WATER)); lenient() <START> .doNothing() <END> .when(battle) .findTargetGroupsAndFire( any(), anyString(), anyBoolean(), any(), any(), anyCollection(), anyCollection(), anyCollection(), anyCollection()); when(gameProperties.get(DEFENDING_SUICIDE_AND_MUNITION_UNITS_DO_NOT_FIRE, false)) .thenReturn(false); when(gameProperties.get(SUB_RETREAT_BEFORE_BATTLE, false)).thenReturn(false); when(gameProperties.get(TRANSPORT_CASUALTIES_RESTRICTED, false)).thenReturn(false); when(gameProperties.get(WW2V2, false)).thenReturn(ww2v2); lenient() .when(gameProperties.get(DEFENDING_SUBS_SNEAK_ATTACK, false)) .thenReturn(defendingSubsSneakAttack); final Unit attackerUnit = attackerDestroyer ? givenUnitDestroyer() : givenAnyUnit(); final Unit defenderUnit = defenderDestroyer ? givenUnitDestroyer() : givenAnyUnit(); battle.setUnits( List.of(defenderUnit, givenUnitFirstStrike()), List.of(attackerUnit, givenUnitFirstStrike()), List.of(), List.of(), defender, List.of()); return battle; }</code><technical_language>Is this 'lenient' 'doNothing' expectation required</technical_language>

Target:
private MustFightBattle givenFirstStrikeBattleSetup( final boolean attackerDestroyer, final boolean defenderDestroyer, final boolean ww2v2, final boolean defendingSubsSneakAttack) { final MustFightBattle battle = spy(newBattle(WATER)); when(gameProperties.get(DEFENDING_SUICIDE_AND_MUNITION_UNITS_DO_NOT_FIRE, false)) .thenReturn(false); when(gameProperties.get(SUB_RETREAT_BEFORE_BATTLE, false)).thenReturn(false); when(gameProperties.get(TRANSPORT_CASUALTIES_RESTRICTED, false)).thenReturn(false); when(gameProperties.get(WW2V2, false)).thenReturn(ww2v2); lenient() .when(gameProperties.get(DEFENDING_SUBS_SNEAK_ATTACK, false)) .thenReturn(defendingSubsSneakAttack); final Unit attackerUnit = attackerDestroyer ? givenUnitDestroyer() : givenAnyUnit(); final Unit defenderUnit = defenderDestroyer ? givenUnitDestroyer() : givenAnyUnit(); battle.setUnits( List.of(defenderUnit, givenUnitFirstStrike()), List.of(attackerUnit, givenUnitFirstStrike()), List.of(), List.of(), defender, List.of()); return battle; }
Source:
<code><START> protected boolean canDoAction() { <END> return super.canDoAction(); }</code><technical_language>needed</technical_language>

Target:
protected boolean canDoAction() { DiskProfileValidator validator = new DiskProfileValidator(getParameters().getProfile()); return validate(validator.diskProfileIsSet()) && validate(validator.storageDomainExists()) && validate(validator.qosExistsOrNull()) && validate(validator.diskProfileNameNotUsed()); }
Source:
<code>public void testGetADCValueSuccess() throws Exception { ATCommandResponse mockedResponse = Mockito.mock(ATCommandResponse.class); Mockito.when(mockedResponse.getResponseStatus()).thenReturn(ATCommandStatus.OK); Mockito.when(mockedResponse.getResponse()).thenReturn(new byte[0]); Mockito.doReturn(mockedResponse).when(xbeeDevice).sendATCommand((ATCommand)Mockito.any()); HashMap<IOLine, Integer> analogValues = new HashMap<IOLine, Integer>(); analogValues.put(IOLine.DIO0_AD0, 850); IOSample mockedIOSample = Mockito.mock(IOSample.class); Mockito.when(mockedIOSample.hasAnalogValues()).thenReturn(true); Mockito.when(mockedIOSample.getAnalogValues()).thenReturn(analogValues); PowerMockito.whenNew(IOSample.class).withAnyArguments().thenReturn(mockedIOSample); int analogValue = -1; try { <START> analogValue = xbeeDevice.getADCValue(IOLine.DIO0_AD0); <END> } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { fail("This exception shouldn't be thrown now."); } assertEquals(850, analogValue); }</code><technical_language>Do catch exceptions throw them, if this occurs test case is failing is need</technical_language>

Target:
public void testGetADCValueSuccess() throws Exception { ATCommandResponse mockedResponse = Mockito.mock(ATCommandResponse.class); Mockito.when(mockedResponse.getResponseStatus()).thenReturn(ATCommandStatus.OK); Mockito.when(mockedResponse.getResponse()).thenReturn(new byte[1]); Mockito.doReturn(mockedResponse).when(xbeeDevice).sendATCommand((ATCommand)Mockito.any()); HashMap<IOLine, Integer> analogValues = new HashMap<IOLine, Integer>(); analogValues.put(IOLine.DIO0_AD0, 850); IOSample mockedIOSample = Mockito.mock(IOSample.class); Mockito.when(mockedIOSample.hasAnalogValues()).thenReturn(true); Mockito.when(mockedIOSample.getAnalogValues()).thenReturn(analogValues); PowerMockito.whenNew(IOSample.class).withAnyArguments().thenReturn(mockedIOSample); int analogValue = -1; analogValue = xbeeDevice.getADCValue(IOLine.DIO0_AD0); assertEquals(850, analogValue); }
Source:
<code>public Token retrieveCurrentToken() { Token token = new Token(); if (findAndSetJWT()) { Token userToken = getUserIdentityFromJWT(); if(userToken != null) { token.setUserIdentity(userToken.getUserIdentity()); token.setUserType(userToken.getUserType()); token.setId(userToken.getId()); token.setJwt(getJWT()); } } <START> log.info("retrieveCurrentToken returning {}", token); <END> return token; }</code><technical_language>This in log info level. do think</technical_language>

Target:
public Token retrieveCurrentToken() { Token token = new Token(); if (findAndSetJWT()) { Token userToken = getUserIdentityFromJWT(); if(userToken != null) { token.setUserIdentity(userToken.getUserIdentity()); token.setUserType(userToken.getUserType()); token.setJwt(getJWT()); } } log.debug("retrieveCurrentToken returning {}", token); return token; }
Source:
<code>public List<Map<KVariable, K>> match(K k, org.kframework.definition.Rule rule) { <START> return (List<Map<KVariable, K>>) search(k, Optional.of(0), Optional.empty(), rule); <END> }</code><technical_language>I suggest instead a List<? extends Map<? extends KVariabale, ? extends K>> technically this is a safe cast</technical_language>

Target:
public List<? extends Map<? extends KVariable,? extends K>> match(K k, org.kframework.definition.Rule rule) { return search(k, Optional.of(0), Optional.empty(), rule); }
Source:
<code>public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, final SyncResult syncResult) { EmailKeyHelper.importContacts(getContext(), new Messenger(new Handler(Looper.getMainLooper(), new Handler.Callback() { @Override public boolean handleMessage(Message msg) { Bundle data = msg.getData(); switch (msg.arg1) { case KeychainIntentServiceHandler.MESSAGE_OKAY: return true; case KeychainIntentServiceHandler.MESSAGE_UPDATE_PROGRESS: if (data.containsKey(KeychainIntentServiceHandler.DATA_PROGRESS) && data.containsKey(KeychainIntentServiceHandler.DATA_PROGRESS_MAX)) { <START> Log.d("Keychain/ContactSync/DownloadKeys", "Progress: " + <END> data.getInt(KeychainIntentServiceHandler.DATA_PROGRESS) + "/" + data.getInt(KeychainIntentServiceHandler.DATA_PROGRESS_MAX)); return false; } default: Log.d("Keychain/ContactSync/DownloadKeys", "Syncing... " + msg.toString()); return false; } } }))); KeychainApplication.setupAccountAsNeeded(ContactSyncAdapterService.this); ContactHelper.writeKeysToContacts(ContactSyncAdapterService.this); }</code><technical_language>Please Constants.TAG :)</technical_language>

Target:
public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, final SyncResult syncResult) { EmailKeyHelper.importContacts(getContext(), new Messenger(new Handler(Looper.getMainLooper(), new Handler.Callback() { @Override public boolean handleMessage(Message msg) { Bundle data = msg.getData(); switch (msg.arg1) { case KeychainIntentServiceHandler.MESSAGE_OKAY: return true; case KeychainIntentServiceHandler.MESSAGE_UPDATE_PROGRESS: if (data.containsKey(KeychainIntentServiceHandler.DATA_PROGRESS) && data.containsKey(KeychainIntentServiceHandler.DATA_PROGRESS_MAX)) { Log.d(Constants.TAG, "Progress: " + data.getInt(KeychainIntentServiceHandler.DATA_PROGRESS) + "/" + data.getInt(KeychainIntentServiceHandler.DATA_PROGRESS_MAX)); return false; } default: Log.d(Constants.TAG, "Syncing... " + msg.toString()); return false; } } }))); KeychainApplication.setupAccountAsNeeded(ContactSyncAdapterService.this); ContactHelper.writeKeysToContacts(ContactSyncAdapterService.this); }
Source:
<code>public ICPPExecution getConstructorChainExecution() { <START> return getConstructorChainExecution(getDefinition()); <END> }</code><technical_language>function body executions, compute constructor chain executions if function is constexpr</technical_language>

Target:
public ICPPExecution getConstructorChainExecution() { if(!isConstexpr()) return null; return getConstructorChainExecution(getDefinition()); }
Source:
<code><START> public HotPlugUnplgNicVDSParameters(Guid vdsId, VM vm, VmNetworkInterface nic, VmDevice vmDevice) { <END> super(vdsId); this.vmId = vm.getId(); this.nic = nic; this.vmDevice = vmDevice; this.clusterVersion = vm.getvds_group_compatibility_version(); }</code><technical_language>add getter for VM it, instead of splitting fields</technical_language>

Target:
public HotPlugUnplgNicVDSParameters(Guid vdsId, VM vm, VmNetworkInterface nic, VmDevice vmDevice) { super(vdsId); this.vm = vm; this.nic = nic; this.vmDevice = vmDevice; }
Source:
<code>public void addTagToImage(String newTag) { select(); new ContextMenu("Add Tag").select(); <START> new LabeledText("New Tag:").setText(newTag); <END> new FinishButton().click(); }</code><technical_language>Is this safe? Shell rename tag focused sometimes, a good practice new DefaultShell(title) focus shell working readable code (you precisely happening in you). a note. know, new DefaultShell(title) wait for a new shell for 10 seconds focus new shell? is identical new WaitUntil(new ShelLWithTextIsAvailable(title), TimePeriod.NORMAL), - dont write code ;)</technical_language>

Target:
public void addTagToImage(String newTag) { select(); new ContextMenu("Add Tag").select(); new DefaultShell(""); new LabeledText("New Tag:").setText(newTag); new FinishButton().click(); }