auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int createApplication(ServiceProvider serviceProvider, String tenantDomain, String userName) throws IdentityApplicationManagementException { try { startTenantFlow(tenantDomain, userName); <START> List<ApplicationMgtListener> listeners = ApplicationMgtListenerServiceComponent.getListners(); <END> for (ApplicationMgtListener listener : listeners) { if(!listener.doPreCreateApplication(serviceProvider)){ return 0; } } ApplicationMgtUtil.createAppRole(serviceProvider.getApplicationName()); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); ApplicationMgtUtil.storePermission(serviceProvider.getApplicationName(), serviceProvider.getPermissionAndRoleConfig()); int applicationId = appDAO.createApplication(serviceProvider, tenantDomain); for (ApplicationMgtListener listener : listeners) { if(!listener.doPostCreateApplication(serviceProvider)){ return 0; } } return applicationId; } catch (Exception e) { try { ApplicationMgtUtil.deleteAppRole(serviceProvider.getApplicationName()); ApplicationMgtUtil.deletePermissions(serviceProvider.getApplicationName()); } catch (Exception ignored) { if (log.isDebugEnabled()) { log.debug("Ignored the exception occurred while trying to delete the role : ", e); } } String error = "Error occurred while creating the application : " + serviceProvider.getApplicationName(); log.error(error, e); throw new IdentityApplicationManagementException(error, e); } finally { endTenantFlow(); } }</code><technical_language>change return type of createApplication void. int returned is auto-generated table ID returned, in client side well</technical_language>

Target:
public void createApplication(ServiceProvider serviceProvider, String tenantDomain, String userName) throws IdentityApplicationManagementException { List<ApplicationMgtListener> listeners = ApplicationMgtListenerServiceComponent.getListners(); for (ApplicationMgtListener listener : listeners) { if (!listener.doPreCreateApplication(serviceProvider,tenantDomain, userName )) { return; } } startTenantFlow(tenantDomain, userName); try { ApplicationMgtUtil.createAppRole(serviceProvider.getApplicationName()); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); ApplicationMgtUtil.storePermission(serviceProvider.getApplicationName(), serviceProvider.getPermissionAndRoleConfig()); appDAO.createApplication(serviceProvider, tenantDomain); } catch (Exception e) { try { ApplicationMgtUtil.deleteAppRole(serviceProvider.getApplicationName()); ApplicationMgtUtil.deletePermissions(serviceProvider.getApplicationName()); } catch (Exception ignored) { if (log.isDebugEnabled()) { log.debug("Ignored the exception occurred while trying to delete the role : ", e); } } String error = "Error occurred while creating the application : " + serviceProvider.getApplicationName(); log.error(error, e); throw new IdentityApplicationManagementException(error, e); } finally { endTenantFlow(); } for (ApplicationMgtListener listener : listeners) { if (!listener.doPostCreateApplication(serviceProvider, tenantDomain, userName)) { return; } } }
Source:
<code>Mono<PartitionPublishingState> getPartitionPublishingState(String partitionId) { <START> PartitionPublishingState publishingState = getClientPartitionPublishingState(partitionId); <END> if (publishingState.isFromLink()) { return Mono.just(publishingState); } else { return withRetry(this.getSendLink(partitionId).flatMap(amqpSendLink -> Mono.just(this.getClientPartitionPublishingState(partitionId))), retryOptions.getTryTimeout(), retryPolicy); } }</code><technical_language>of this wrapped in Mono.defer()</technical_language>

Target:
Mono<PartitionPublishingState> getPartitionPublishingState(String partitionId) { PartitionPublishingState publishingState = getClientPartitionPublishingState(partitionId); if (publishingState.isFromLink()) { return Mono.defer(() -> Mono.just(publishingState)); } else { return withRetry(getSendLink(partitionId).flatMap(amqpSendLink -> Mono.just(getClientPartitionPublishingState(partitionId))), retryOptions.getTryTimeout(), retryPolicy); } }
Source:
<code>public void onEvent(ActivitiEvent event) { <START> CommandContext currentCommandContext = Context.getCommandContext(); <END> ProcessEngineEvent newEvent = converterContext.from(event); if (newEvent == null) { return; } @SuppressWarnings("unchecked") List<ProcessEngineEvent> events = (List<ProcessEngineEvent>) currentCommandContext .getAttribute(MessageProducerCommandContextCloseListener.PROCESS_ENGINE_EVENTS); if (events != null) { events.add(newEvent); } else { events = new ArrayList<ProcessEngineEvent>(); events.add(newEvent); currentCommandContext.addAttribute(MessageProducerCommandContextCloseListener.PROCESS_ENGINE_EVENTS, events); } List<CommandContextCloseListener> listeners = currentCommandContext.getCloseListeners(); if (listeners.size() != 0) { for (CommandContextCloseListener listener : listeners) { if (listener instanceof MessageProducerCommandContextCloseListener) { return; } } } MessageProducerCommandContextCloseListener messageListener = new MessageProducerCommandContextCloseListener( producer); currentCommandContext.addCloseListener(messageListener); }</code><technical_language>I is unit test for this class yet, I right moment do so. This static call Context.getCommandContext() prevent mocking context. suggest extract this a ContextWrapper component is injected in MessageProducerActivitiEventListener , mock it. do think</technical_language>

Target:
public void onEvent(ActivitiEvent event) { CommandContext currentCommandContext = Context.getCommandContext(); ProcessEngineEvent newEvent = converterContext.from(event); if (newEvent == null) { return; } List<ProcessEngineEvent> events = currentCommandContext.getGenericAttribute(MessageProducerCommandContextCloseListener.PROCESS_ENGINE_EVENTS); if (events != null) { events.add(newEvent); } else { events = new ArrayList<>(); events.add(newEvent); currentCommandContext.addAttribute(MessageProducerCommandContextCloseListener.PROCESS_ENGINE_EVENTS, events); } if (!currentCommandContext.hasCloseListener(MessageProducerCommandContextCloseListener.class)) { currentCommandContext.addCloseListener(messageListener); } }
Source:
<code>static void moveExeFileToSeLionHomeAndDeleteExtras() { File source = new File(SeLionConstants.SELION_HOME_DIR + File.separator + "Microsoft Web Driver" + File.separator + "MicrosoftWebDriver.exe"); File dest = new File(SeLionConstants.SELION_HOME_DIR); try { FileUtils.copyFileToDirectory(source, dest, true); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error while moving MicrosoftWebDriver.exe file from '" + source.getAbsolutePath() + "' to '" + dest.getAbsolutePath() + "'", e); } try { <START> FileUtils.deleteDirectory(new File(SeLionConstants.SELION_HOME_DIR + File.separator <END> + "Microsoft Web Driver")); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Exception while deleting 'Microsoft Web Driver' folder", e); } File extraMsiFileCreatedByMsiexec = new File(SeLionConstants.SELION_HOME_DIR + "MicrosoftWebDriver.msi"); if (extraMsiFileCreatedByMsiexec.exists()) { FileUtils.deleteQuietly(extraMsiFileCreatedByMsiexec); } }</code><technical_language>FileUtils.moveFile() instead</technical_language>

Target:
static void moveExeFileToSeLionHomeAndDeleteExtras() { File source = new File(SeLionConstants.SELION_HOME_DIR + File.separator + "Microsoft Web Driver" + File.separator + SeLionConstants.EDGE_DRIVER); File dest = new File(SeLionConstants.SELION_HOME_DIR); try { FileUtils.copyFileToDirectory(source, dest, true); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error while moving MicrosoftWebDriver.exe file from '" + source.getAbsolutePath() + "' to '" + dest.getAbsolutePath() + "'", e); } try { FileUtils.deleteDirectory(new File(SeLionConstants.SELION_HOME_DIR + File.separator + "Microsoft Web Driver")); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Exception while deleting 'Microsoft Web Driver' folder", e); } File extraMsiFileCreatedByMsiexec = new File(SeLionConstants.SELION_HOME_DIR + "MicrosoftWebDriver.msi"); if (extraMsiFileCreatedByMsiexec.exists()) { FileUtils.deleteQuietly(extraMsiFileCreatedByMsiexec); } }
Source:
<code>public void testGetKeyForStudent() throws Exception { <START> restoreTypicalDataInDatastore(); <END> ______TS("null parameters"); try { studentsLogic.getKeyForStudent("valid.course.id", null); Assert.fail(); } catch (AssertionError a) { assertEquals("Supplied parameter was null\n", a.getMessage()); } ______TS("non-existent student"); StudentAttributes student = dataBundle.students.get("student1InCourse1"); assertEquals(null, studentsLogic.getKeyForStudent(student.course, "non@existent")); }</code><technical_language>If need this line beginning of @Test, put in a @BeforeMethod method</technical_language>

Target:
public void testGetKeyForStudent() throws Exception { ______TS("null parameters"); try { studentsLogic.getKeyForStudent("valid.course.id", null); signalFailureToDetectException(); } catch (AssertionError a) { assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, a.getMessage()); } ______TS("non-existent student"); StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); String nonExistStudentEmail = "non@existent"; try { studentsLogic.getKeyForStudent(student1InCourse1.course, nonExistStudentEmail); signalFailureToDetectException(); } catch (EntityDoesNotExistException e) { String expectedErrorMsg = "Student does not exist: [" + student1InCourse1.course + "/" + nonExistStudentEmail + "]"; assertEquals(expectedErrorMsg, e.getMessage()); } ______TS("typical case"); String course1Id = dataBundle.courses.get("typicalCourse1").id; String actualKey = studentsLogic.getKeyForStudent(course1Id, student1InCourse1.email); String expectedKey = studentsLogic.getStudentForCourseIdAndGoogleId(course1Id, student1InCourse1.googleId).key; assertEquals(expectedKey, actualKey); }
Source:
<code>private void onServiceStateChange(SyncthingService.State currentState) { mServiceState = currentState; switch (mServiceState) { case ERROR: <START> case INIT: <END> case STARTING: dismissDisabledDialog(); showLoadingDialog(); break; case ACTIVE: dismissDisabledDialog(); dismissLoadingDialog(); break; case DISABLED: if (!mIsPaused) { showDisabledDialog(); } break; default: break; } }</code><technical_language>want fall loading dialog in case of error</technical_language>

Target:
private void onServiceStateChange(SyncthingService.State currentState) { mServiceState = currentState; switch (mServiceState) { case INIT: case STARTING: dismissDisabledDialog(); showLoadingDialog(); break; case ACTIVE: dismissDisabledDialog(); dismissLoadingDialog(); break; case DISABLED: if (!mIsPaused) { showDisabledDialog(); } break; case ERROR: default: break; } }
Source:
<code>public void testCreateWebhooksFail() throws IOException, InterruptedException { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404).setBody(stringFromResource("/autoscale_webhooks_create_response.json")))); try { AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides); WebhookApi api = autoscaleApi.getWebhookApiForZoneAndGroupAndPolicy("DFW", "1234567890", "321456"); FluentIterable<WebhookResponse> webhooks = api.create(ImmutableList.of( Webhook.builder().name("PagerDuty").metadata(ImmutableMap.<String, Object>of("notes", "PagerDuty will fire this webhook")).build(), Webhook.builder().name("Nagios").metadata(ImmutableMap.<String, Object>of()).build() )); assertAuthentication(server); assertRequest(server.takeRequest(), "POST", "/v1.0/888888/groups/1234567890/policies/321456/webhooks", "/autoscale_webhooks_create_request.json"); <START> assertTrue(webhooks.isEmpty()); <END> } finally { server.shutdown(); } }</code><technical_language>webhooks.isEmpty(), "Expected webhooks was: " + webhooks, that</technical_language>

Target:
public void testCreateWebhooksFail() throws IOException, InterruptedException { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404).setBody(stringFromResource("/autoscale_webhooks_create_response.json")))); try { AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides); WebhookApi api = autoscaleApi.getWebhookApiForZoneAndGroupAndPolicy("DFW", "1234567890", "321456"); FluentIterable<WebhookResponse> webhooks = api.create(ImmutableList.of( Webhook.builder().name("PagerDuty").metadata(ImmutableMap.<String, Object>of("notes", "PagerDuty will fire this webhook")).build(), Webhook.builder().name("Nagios").metadata(ImmutableMap.<String, Object>of()).build() )); assertAuthentication(server); assertRequest(server.takeRequest(), "POST", "/v1.0/888888/groups/1234567890/policies/321456/webhooks", "/autoscale_webhooks_create_request.json"); assertTrue(webhooks.isEmpty(), "Expected no webhooks, but was: " + webhooks); } finally { server.shutdown(); } }
Source:
<code><START> public static Tech[] getAll() { <END> return allTech.toArray(new Tech[] {}); }</code><technical_language>return a collection, create a new array time. - a tag</technical_language>

Target:
public static Set<Tech> getAll() { return Collections.unmodifiableSet(allTech); }
Source:
<code><START> public String generateCommonPart(String subscriptionId, String resourceGroup) { <END> StringBuilder sb = new StringBuilder(); sb.append("/subscriptions/"); sb.append(subscriptionId); sb.append("/resourceGroups/"); sb.append(resourceGroup); return sb.toString(); }</code><technical_language>this private, if this public want add asserts for parameters</technical_language>

Target:
private String generateCommonPart(String subscriptionId, String resourceGroup) { return String.format("/subscriptions/%s/resourceGroups/%s", subscriptionId, resourceGroup); }
Source:
<code>public int hashCode() { return Objects.hash(endpoint, secureEndpoint, keyStorePath, keyStorePassword, virtualHost, servicePath, v4MaxNonChunkedRequestSize, ignoreUnknownHeaders, <START> corsRules.hashCode()); <END> }</code><technical_language>pass corsRules instead of hashCode</technical_language>

Target:
public int hashCode() { return Objects.hash(endpoint, secureEndpoint, keyStorePath, keyStorePassword, virtualHost, servicePath, v4MaxNonChunkedRequestSize, ignoreUnknownHeaders, corsRules); }
Source:
<code>public void setInterrupted(boolean interrupted) { this.interrupted = interrupted; messageListener.interrupt(); try { if (connector != null) { connector.disconnect(); } } catch (OpenEnergyMonitorException e) { <START> logger.error("Error occured when closing connection", e); <END> } }</code><technical_language>This a WARN instead of ERROR. Also, "occurred"</technical_language>

Target:
public void setInterrupted(boolean interrupted) { this.interrupted = interrupted; messageListener.interrupt(); try { if (connector != null) { connector.disconnect(); } } catch (OpenEnergyMonitorException e) { logger.warn("Error occurred when closing connection. ", e); } }
Source:
<code>public static boolean renameProject(File xmlFile, String dstName) throws IOException { if (!xmlFile.exists()) { throw new FileNotFoundException(xmlFile + " does not exist."); } String currentXml = Files.toString(xmlFile, Charsets.UTF_8); StringFinder stringFinder = new StringFinder(); if (!stringFinder.findBetween(currentXml, PROGRAM_NAME_START_TAG, PROGRAM_NAME_END_TAG)) { return false; } String srcName = stringFinder.getResult(); dstName = new XStream().toXML(dstName); dstName = dstName.replace("<string>", ""); <START> dstName = dstName.replace("</string>", ""); <END> if (srcName.equals(dstName)) { return true; } String srcProjectNameTag = PROGRAM_NAME_START_TAG + srcName + PROGRAM_NAME_END_TAG; String dstProjectNameTag = PROGRAM_NAME_START_TAG + dstName + PROGRAM_NAME_END_TAG; String newXml = currentXml.replace(srcProjectNameTag, dstProjectNameTag); if (currentXml.equals(newXml)) { Log.e(TAG, "Cannot find projectNameTag in code.xml"); return false; } StorageOperations.writeToFile(xmlFile, newXml); return true; }</code><technical_language>extract string operations in extra function, a bit more clean read</technical_language>

Target:
public static boolean renameProject(File xmlFile, String dstName) throws IOException { if (!xmlFile.exists()) { throw new FileNotFoundException(xmlFile + " does not exist."); } String currentXml = Files.toString(xmlFile, Charsets.UTF_8); StringFinder stringFinder = new StringFinder(); if (!stringFinder.findBetween(currentXml, PROGRAM_NAME_START_TAG, PROGRAM_NAME_END_TAG)) { return false; } String srcName = stringFinder.getResult(); dstName = getXMLEncodedString(dstName); if (srcName.equals(dstName)) { return true; } String srcProjectNameTag = PROGRAM_NAME_START_TAG + srcName + PROGRAM_NAME_END_TAG; String dstProjectNameTag = PROGRAM_NAME_START_TAG + dstName + PROGRAM_NAME_END_TAG; String newXml = currentXml.replace(srcProjectNameTag, dstProjectNameTag); if (currentXml.equals(newXml)) { Log.e(TAG, "Cannot find projectNameTag in code.xml"); return false; } StorageOperations.writeToFile(xmlFile, newXml); return true; }
Source:
<code>public void addProcess(String processName, String authKey, String[] cmd, String workingDir, Map<String, String> env) throws IOException { if (processName == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("processName"); } if (authKey == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("authKey"); } if (cmd == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("cmd"); } if (workingDir == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("workingDir"); } if (env == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("env"); } if (cmd.length < 1) { throw ProcessLogger.ROOT_LOGGER.invalidCommandLen(); } if (authKey.length() != ProcessController.AUTH_BYTES_ENCODED_LENGTH) { throw ProcessLogger.ROOT_LOGGER.invalidAuthKeyLen(); } final OutputStream os = connection.writeMessage(); try { os.write(Protocol.ADD_PROCESS); writeUTFZBytes(os, processName); <START> os.write(authKey.getBytes()); <END> writeInt(os, cmd.length); for (String c : cmd) { writeUTFZBytes(os, c); } writeInt(os, env.size()); for (String key : env.keySet()) { final String value = env.get(key); writeUTFZBytes(os, key); if (value != null) { writeUTFZBytes(os, value); } else { writeUTFZBytes(os, ""); } } writeUTFZBytes(os, workingDir); os.close(); } finally { safeClose(os); } }</code><technical_language>needs US-ASCII charset, some other simple ascii encoding conversion</technical_language>

Target:
public void addProcess(String processName, String authKey, String[] cmd, String workingDir, Map<String, String> env) throws IOException { if (processName == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("processName"); } if (authKey == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("authKey"); } if (cmd == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("cmd"); } if (workingDir == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("workingDir"); } if (env == null) { throw ProcessLogger.ROOT_LOGGER.nullVar("env"); } if (cmd.length < 1) { throw ProcessLogger.ROOT_LOGGER.invalidCommandLen(); } if (authKey.length() != ProcessController.AUTH_BYTES_ENCODED_LENGTH) { throw ProcessLogger.ROOT_LOGGER.invalidAuthKeyLen(); } final OutputStream os = connection.writeMessage(); try { os.write(Protocol.ADD_PROCESS); writeUTFZBytes(os, processName); os.write(authKey.getBytes(Charset.forName("US-ASCII"))); writeInt(os, cmd.length); for (String c : cmd) { writeUTFZBytes(os, c); } writeInt(os, env.size()); for (String key : env.keySet()) { final String value = env.get(key); writeUTFZBytes(os, key); if (value != null) { writeUTFZBytes(os, value); } else { writeUTFZBytes(os, ""); } } writeUTFZBytes(os, workingDir); os.close(); } finally { safeClose(os); } }
Source:
<code>public String getServerVersion() { if (getStorageState() != State.UPDATED) { return NEED_UPDATE; } <START> String version = updateStatus.getServerVersion(); <END> return version == null ? "Unknown" : version; }</code><technical_language>I this change GlobalStorageStatus.getServerVersion() method is annotated @CheckForNull I issue, I added check. ignore issue</technical_language>

Target:
public String getServerVersion() { if (getStorageState() != State.UPDATED) { return NEED_UPDATE; } return updateStatus.getServerVersion(); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(new ForceClose(this)); setupTheme(); setupLanguage(); mFragmentManager = getSupportFragmentManager(); mAuthorizationManager = new AuthorizationManager(); locationList = new ArrayList<>(); Bundle extras = getIntent().getExtras(); if (extras != null) { <START> Boolean flag = extras.getBoolean(getString(R.string.boolean_flag)); String errorReport = extras.getString(getString(R.string.error_report)); <END> if (flag) { showAppCrashDialog(errorReport); } } mIntentFilter = new IntentFilter(); mIntentFilter.addAction(ApplicationConstants.BroadcastActions.AUTHENTICATION_CHECK_BROADCAST_ACTION); }</code><technical_language>strings meant translated, move ApplicationConstants instead</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(new ForceClose(this)); setupTheme(); setupLanguage(); mFragmentManager = getSupportFragmentManager(); mAuthorizationManager = new AuthorizationManager(); locationList = new ArrayList<>(); Bundle extras = getIntent().getExtras(); if (extras != null) { Boolean flag = extras.getBoolean(ApplicationConstants.FLAG); String errorReport = extras.getString(ApplicationConstants.ERROR); if (flag) { showAppCrashDialog(errorReport); } } mIntentFilter = new IntentFilter(); mIntentFilter.addAction(ApplicationConstants.BroadcastActions.AUTHENTICATION_CHECK_BROADCAST_ACTION); }
Source:
<code>public void testExceptionNestedOnStartConfigError() throws Exception { Throwable cause = new RuntimeException("Exception cause"); Throwable exception = new MembershipConfigurationException("Test exception", cause); doThrow(exception).when(membership).start(); <START> try { <END> distribution.start(); fail("expected start to throw an exception"); } catch (GemFireConfigException e) { assertEquals(e.getCause(), cause); } }</code><technical_language>JUnit [ExpectedException](<LINK_0> I works try catch statements. some examples in Geode code base if want some inspiration</technical_language>

Target:
public void testExceptionNestedOnStartConfigError() throws Exception { Throwable exception = new MembershipConfigurationException("Test exception"); doThrow(exception).when(membership).start(); assertThatThrownBy(() -> distribution.start()) .isInstanceOf(GemFireConfigException.class) .hasCause(exception); }
Source:
<code>private void runConcurrencyTest(List<DiskSpaceRequirements> requirementsList, final boolean allocate, final boolean free) throws Exception { List<Callable<Void>> tasks = new ArrayList<>(); final String filenamePrefix = "conc-test-"; int fileCount = 0; for (final DiskSpaceRequirements requirements : requirementsList) { for (int i = 0; i < requirements.getSegmentsNeeded(); i++, fileCount++) { final String filename = filenamePrefix + fileCount; tasks.add(() -> { if (allocate) { allocateAndVerify(filename, requirements.getSegmentSizeInBytes()); } if (free) { freeAndVerify(new File(allocatedFileDir, filename), requirements.getSegmentSizeInBytes()); } return null; }); <START> fileCount++; <END> } } for (Future<Void> future : exec.invokeAll(tasks)) { future.get(10, TimeUnit.SECONDS); } }</code><technical_language>increment "fileCount" twice? for loop is incrementing right</technical_language>

Target:
private void runConcurrencyTest(List<DiskSpaceRequirements> requirementsList, final boolean allocate, final boolean free) throws Exception { List<Callable<Void>> tasks = new ArrayList<>(); final String filenamePrefix = "conc-test-"; int fileCount = 0; for (final DiskSpaceRequirements requirements : requirementsList) { for (int i = 0; i < requirements.getSegmentsNeeded(); i++, fileCount++) { final String filename = filenamePrefix + fileCount; tasks.add(() -> { if (allocate) { allocateAndVerify(filename, requirements.getSegmentSizeInBytes()); } if (free) { freeAndVerify(new File(allocatedFileDir, filename), requirements.getSegmentSizeInBytes()); } return null; }); } } for (Future<Void> future : exec.invokeAll(tasks)) { future.get(10, TimeUnit.SECONDS); } }
Source:
<code><START> private void checkName(String name) { <END> if (names.contains(name)) { throw new IllegalArgumentException("Duplicate name : " + name); } names.add(name); }</code><technical_language>This called addName(String name) mutative. achieve this a single names.add(name) call</technical_language>

Target:
private void checkName(String name) { if (!names.add(name)) { throw new IllegalArgumentException("Duplicate name : " + name); } }
Source:
<code>public void updatePhysics(GlowBlock me) { Block below = me.getRelative(BlockFace.DOWN); switch (below.getType()) { case AIR: <START> FIRE: <END> WATER: LAVA: transformToFallingEntity(me); } }</code><technical_language>Missing case x3 labels, cases</technical_language>

Target:
public void updatePhysics(GlowBlock me) { Block below = me.getRelative(BlockFace.DOWN); switch (below.getType()) { case AIR: case FIRE: case WATER: case LAVA: transformToFallingEntity(me); } }
Source:
<code>private static Mono<Void> writeBodyToFile(BlobDownloadAsyncResponse response, AsynchronousFileChannel file, long chunkNum, ParallelTransferOptions finalParallelTransferOptions, Lock progressLock, AtomicLong totalProgress) { <START> Flux<ByteBuffer> data = StorageImplUtils.deepCloneStreamBuffers(response.getValue()); <END> data = ProgressReporter.addParallelProgressReporting(data, finalParallelTransferOptions.getProgressReceiver(), progressLock, totalProgress); return FluxUtil.writeFile(data, file, chunkNum * finalParallelTransferOptions.getBlockSize()); }</code><technical_language>I need this copy anymore for files. a deep copy in files, if do a deep copy in this method, copies, right</technical_language>

Target:
private static Mono<Void> writeBodyToFile(BlobDownloadAsyncResponse response, AsynchronousFileChannel file, long chunkNum, ParallelTransferOptions finalParallelTransferOptions, Lock progressLock, AtomicLong totalProgress) { Flux<ByteBuffer> data = response.getValue(); data = ProgressReporter.addParallelProgressReporting(data, finalParallelTransferOptions.getProgressReceiver(), progressLock, totalProgress); return FluxUtil.writeFile(data, file, chunkNum * finalParallelTransferOptions.getBlockSize()); }
Source:
<code>public void updateUseHostCpuAvailability() { boolean clusterSupportsHostCpu = getCompatibilityVersion() != null; <START> boolean vmIsHp = getModel().getVmType().getSelectedItem() == VmType.HighPerformance; <END> boolean vmIsNonMigratable = MigrationSupport.PINNED_TO_HOST == getModel().getMigrationMode().getSelectedItem(); if (clusterSupportsHostCpu && !clusterHasPpcArchitecture() && (vmIsNonMigratable || vmIsHp)) { getModel().getHostCpu().setIsChangeable(true); } else { getModel().getHostCpu().setEntity(false); getModel().getHostCpu().setIsChangeable(false); getModel().getHostCpu().setChangeProhibitionReason(constants.hosCPUUnavailable()); } }</code><technical_language>please add similar note missing numa scheduling policy. need allow for VMs is a (better) cpu flags policy</technical_language>

Target:
public void updateUseHostCpuAvailability() { boolean clusterSupportsHostCpu = getCompatibilityVersion() != null; boolean vmIsNonMigratable = MigrationSupport.PINNED_TO_HOST == getModel().getMigrationMode().getSelectedItem(); if (clusterSupportsHostCpu && !clusterHasPpcArchitecture() && vmIsNonMigratable) { getModel().getHostCpu().setIsChangeable(true); } else { getModel().getHostCpu().setEntity(false); getModel().getHostCpu().setIsChangeable(false); getModel().getHostCpu().setChangeProhibitionReason(constants.hosCPUUnavailable()); } }
Source:
<code>public void deserialize() throws Exception { final InputStream stream = getClass().getResourceAsStream("/dataset/datasetLinks.json"); <START> final DatasetLinks datasetLinkss = new ObjectMapper().readValue(stream, DatasetLinks.class); <END> assertThat(datasetLinkss, is(notNullValue())); assertThat(datasetLinkss.getCategory(), is("singleloadinterface")); assertThat(datasetLinkss.getInstance(), is("MD::LDM::SingleLoadInterface")); assertThat(datasetLinkss.getSummary(), is("single loading interfaces")); final Collection<AboutLinks.Link> links = datasetLinkss.getLinks(); assertThat(links, is(notNullValue())); assertThat(links, hasSize(1)); final AboutLinks.Link link = links.iterator().next(); assertThat(link, is(notNullValue())); assertThat(link.getIdentifier(), is("dataset.person")); assertThat(link.getUri(), is("/gdc/md/PROJECT_ID/ldm/singleloadinterface/dataset.person")); assertThat(link.getCategory(), is("dataset-singleloadinterface")); assertThat(link.getTitle(), is("Person")); assertThat(link.getSummary(), is("dataset single data loading interface specifications")); }</code><technical_language>double 's' end</technical_language>

Target:
public void deserialize() throws Exception { final InputStream stream = getClass().getResourceAsStream("/dataset/datasetLinks.json"); final DatasetLinks datasetLinks = new ObjectMapper().readValue(stream, DatasetLinks.class); assertThat(datasetLinks, is(notNullValue())); assertThat(datasetLinks.getCategory(), is("singleloadinterface")); assertThat(datasetLinks.getInstance(), is("MD::LDM::SingleLoadInterface")); assertThat(datasetLinks.getSummary(), is("single loading interfaces")); final Collection<AboutLinks.Link> links = datasetLinks.getLinks(); assertThat(links, is(notNullValue())); assertThat(links, hasSize(1)); final AboutLinks.Link link = links.iterator().next(); assertThat(link, is(notNullValue())); assertThat(link.getIdentifier(), is("dataset.person")); assertThat(link.getUri(), is("/gdc/md/PROJECT_ID/ldm/singleloadinterface/dataset.person")); assertThat(link.getCategory(), is("dataset-singleloadinterface")); assertThat(link.getTitle(), is("Person")); assertThat(link.getSummary(), is("dataset single data loading interface specifications")); }
Source:
<code>private void sendNotification() { try { Role cmsAdminRole = APILocator.getRoleAPI().loadCMSAdminRole(); APILocator.getNotificationAPI().generateNotification( <START> new I18NMessage("NO DEFUALT HOST"), END> new I18NMessage("THERE IS NO DEFAULT HOST " ), null, NotificationLevel.INFO, NotificationType.GENERIC, Visibility.ROLE, cmsAdminRole.getId(), APILocator.systemUser().getUserId(), APILocator.systemUser().getLocale()); throw new DotStateException("NO DEFUALT HOST, creating a fake one"); } catch (Exception e) { Logger.error(this, e.getMessage(), e); } }</code><technical_language>Typo in DEFUALT</technical_language>

Target:
private void sendNotification() { try { Role cmsAdminRole = APILocator.getRoleAPI().loadCMSAdminRole(); APILocator.getNotificationAPI().generateNotification( new I18NMessage("NO DEFAULT HOST"), new I18NMessage("THERE IS NO DEFAULT HOST " ), null, NotificationLevel.INFO, NotificationType.GENERIC, Visibility.ROLE, cmsAdminRole.getId(), APILocator.systemUser().getUserId(), APILocator.systemUser().getLocale()); throw new DotStateException("NO DEFAULT HOST, creating a fake one"); } catch (Exception e) { Logger.error(this, e.getMessage(), e); } }
Source:
<code>private void updateActionAvailability() { VDS vds = getEntity(); <START> getSyncStorageDevicesCommand().setIsExecutionAllowed(VDSStatus.Up.equals(vds.getStatus())); <END> }</code><technical_language>vds.getStatus() == VDSStatus.Up</technical_language>

Target:
private void updateActionAvailability() { VDS vds = getEntity(); getSyncStorageDevicesCommand().setIsExecutionAllowed(vds.getStatus() == VDSStatus.Up); }
Source:
<code><START> private void setEntityArmorWithChance(Random random, EntityLivingBase entity, ToolsItem sword, ToolsItem helmet, ToolsItem chestplate, ToolsItem leggings, ToolsItem boots) { <END> setStackIfCaseAndEmpty(entity, EntityEquipmentSlot.MAINHAND, sword.getItemStack(), entity instanceof EntityZombie && random.nextInt(100) < 50); setStackIfCaseAndEmpty(entity, EntityEquipmentSlot.HEAD, helmet.getItemStack(), random.nextInt(100) < 50); setStackIfCaseAndEmpty(entity, EntityEquipmentSlot.CHEST, chestplate.getItemStack(), random.nextInt(100) < 50); setStackIfCaseAndEmpty(entity, EntityEquipmentSlot.LEGS, leggings.getItemStack(), random.nextInt(100) < 50); setStackIfCaseAndEmpty(entity, EntityEquipmentSlot.FEET, boots.getItemStack(), random.nextInt(100) < 50); }</code><technical_language>Personally a fan of this; separate if statements clearer a conditional thing, without, itemstack created</technical_language>

Target:
private void setEntityArmorWithChance(Random random, EntityLivingBase entity, ToolsItem sword, ToolsItem helmet, ToolsItem chestplate, ToolsItem leggings, ToolsItem boots) { if (entity instanceof EntityZombie && random.nextInt(100) < 50) { setStackIfEmpty(entity, EntityEquipmentSlot.MAINHAND, sword.getItemStack()); } if (random.nextInt(100) < 50) { setStackIfEmpty(entity, EntityEquipmentSlot.HEAD, helmet.getItemStack()); } if (random.nextInt(100) < 50) { setStackIfEmpty(entity, EntityEquipmentSlot.CHEST, chestplate.getItemStack()); } if (random.nextInt(100) < 50) { setStackIfEmpty(entity, EntityEquipmentSlot.LEGS, leggings.getItemStack()); } if (random.nextInt(100) < 50) { setStackIfEmpty(entity, EntityEquipmentSlot.FEET, boots.getItemStack()); } }
Source:
<code>public boolean createOvfStoreDisks(int missingDiskCount) { boolean <START> AllOvfStoreDisksCreated = <END> true; for (int i = 0; i < missingDiskCount; i++) { CreateOvfVolumeForStorageDomainCommandParameters parameters = createCreateOvfVolumeForStorageDomainParams(); ActionReturnValue returnValue = runInternalAction(ActionType.CreateOvfVolumeForStorageDomain, parameters, getContext().clone().withoutLock()); if (!returnValue.getSucceeded()) { AllOvfStoreDisksCreated = false; } } return AllOvfStoreDisksCreated; }</code><technical_language>This renamed camelcase: allOvfStoreDisksCreated</technical_language>

Target:
public boolean createOvfStoreDisks(int missingDiskCount) { boolean allOvfStoreDisksCreated = true; for (int i = 0; i < missingDiskCount; i++) { CreateOvfVolumeForStorageDomainCommandParameters parameters = createCreateOvfVolumeForStorageDomainParams(); ActionReturnValue returnValue = runInternalAction(ActionType.CreateOvfVolumeForStorageDomain, parameters, getContext().clone().withoutLock()); if (!returnValue.getSucceeded()) { allOvfStoreDisksCreated = false; } } return allOvfStoreDisksCreated; }
Source:
<code>private GatewayOrder buildAuthoriseOrder(CardAuthorisationGatewayRequest request, String frontendUrl) { EpdqTemplateData templateData = new EpdqTemplateData(); templateData.setOrderId(request.getChargeExternalId()); templateData.setPassword(request.getGatewayAccount().getCredentials().get(CREDENTIALS_PASSWORD)); templateData.setShaInPassphrase(request.getGatewayAccount().getCredentials().get(CREDENTIALS_SHA_IN_PASSPHRASE)); templateData.setUserId(request.getGatewayAccount().getCredentials().get(CREDENTIALS_USERNAME)); templateData.setMerchantCode(request.getGatewayAccount().getCredentials().get(CREDENTIALS_MERCHANT_ID)); templateData.setDescription(request.getDescription()); templateData.setAmount(request.getAmount()); templateData.setAuthCardDetails(request.getAuthCardDetails()); EpdqPayloadDefinition epdqPayloadDefinition; if (request.getGatewayAccount().isRequires3ds()) { if (request.getGatewayAccount().getIntegrationVersion3ds() == 2) { epdqPayloadDefinition = new EpdqPayloadDefinitionForNew3ds2Order(frontendUrl, request.getCharge().getLanguage(), Clock.systemUTC()); } else { epdqPayloadDefinition = new EpdqPayloadDefinitionForNew3dsOrder(frontendUrl); } } else { epdqPayloadDefinition = epdqPayloadDefinitionForNewOrder; <START> } <END> return epdqPayloadDefinition.createGatewayOrder(templateData); }</code><technical_language>a switch expression work here? java switch(request.getGatewayAccount().getIntegrationVersion3ds()) { case 2: epdqPayloadDefinition = new EpdqPayloadDefinitionForNew3ds2Order(frontendUrl, request.getCharge().getLanguage(), Clock.systemUTC()); break; case 1: default: epdqPayloadDefinition = new EpdqPayloadDefinitionForNew3dsOrder(frontendUrl); } if better. leave you</technical_language>

Target:
private GatewayOrder buildAuthoriseOrder(CardAuthorisationGatewayRequest request, String frontendUrl) { EpdqTemplateData templateData = new EpdqTemplateData(); templateData.setOrderId(request.getChargeExternalId()); templateData.setPassword(request.getGatewayAccount().getCredentials().get(CREDENTIALS_PASSWORD)); templateData.setShaInPassphrase(request.getGatewayAccount().getCredentials().get(CREDENTIALS_SHA_IN_PASSPHRASE)); templateData.setUserId(request.getGatewayAccount().getCredentials().get(CREDENTIALS_USERNAME)); templateData.setMerchantCode(request.getGatewayAccount().getCredentials().get(CREDENTIALS_MERCHANT_ID)); templateData.setDescription(request.getDescription()); templateData.setAmount(request.getAmount()); templateData.setAuthCardDetails(request.getAuthCardDetails()); EpdqPayloadDefinition epdqPayloadDefinition; if (request.getGatewayAccount().isRequires3ds()) { if (request.getGatewayAccount().getIntegrationVersion3ds() == 2) { epdqPayloadDefinition = new EpdqPayloadDefinitionForNew3ds2Order(frontendUrl, request.getCharge().getLanguage(), clock); } else { epdqPayloadDefinition = new EpdqPayloadDefinitionForNew3dsOrder(frontendUrl); } } else { epdqPayloadDefinition = epdqPayloadDefinitionForNewOrder; } return epdqPayloadDefinition.createGatewayOrder(templateData); }
Source:
<code>private List<Folder> findContainersAssetsByHost(final Host host, final User user) { List<Contentlet> containers = null; final List<Folder> folders = new ArrayList<>(); try{ <START> final String query = builder("+structureType:", Structure.STRUCTURE_TYPE_FILEASSET, <END> " +path:", Constants.CONTAINER_FOLDER_PATH, " container.vtl", " +conhost:", host.getIdentifier()).toString(); containers = this.permissionAPI.filterCollection( this.contentletAPI.search(query,-1, 0, null , user, false), PermissionAPI.PERMISSION_READ, false, user); for(final Contentlet container : containers) { folders.add(this.folderAPI.find(container.getFolder(), user, false)); } } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } return folders; }</code><technical_language>Do care this point of status of container.vtl file?, meaning +live:true</technical_language>

Target:
private List<Folder> findContainersAssetsByHost(final Host host, final User user) { List<Contentlet> containers = null; final List<Folder> folders = new ArrayList<>(); try{ final String query = builder("+structureType:", Structure.STRUCTURE_TYPE_FILEASSET, " +path:", Constants.CONTAINER_FOLDER_PATH, " container.vtl", " +conhost:", host.getIdentifier(), " +working:true +deleted:false").toString(); containers = this.permissionAPI.filterCollection( this.contentletAPI.search(query,-1, 0, null , user, false), PermissionAPI.PERMISSION_READ, false, user); for(final Contentlet container : containers) { folders.add(this.folderAPI.find(container.getFolder(), user, false)); } } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } return folders; }
Source:
<code>private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(getUser(sessionId, false)); <START> engineSession.setEngineSessionId(sessionId); <END> sessionInfo.contentOfSession.put(ENGINE_SESSION_SEQ_ID, getDbFacade().getEngineSessionDao().save(engineSession)); } }</code><technical_language>instead of setEngineSessionId - ctor</technical_language>

Target:
private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { sessionInfo.contentOfSession.put(ENGINE_SESSION_SEQ_ID, getDbFacade().getEngineSessionDao().save(new EngineSession(getUser(sessionId, false), sessionId))); } }
Source:
<code>public void assertShadowVariablesAreNotStale(Score expectedWorkingScore, Object completedAction) { Map<ShadowVariableDescriptor, List<String>> shadowVariableDescriptorListMap = calculateShadowVariableViolationListMap(); if (!shadowVariableDescriptorListMap.isEmpty()) { StringBuilder message = new StringBuilder(); message.append(VariableListener.class.getSimpleName()).append(" corruption after completedAction (") .append(completedAction).append("):\n"); shadowVariableDescriptorListMap.forEach((shadowVariableDescriptor, violationList) -> { message.append(violationList.get(0)); if (violationList.size() > 1) { <START> message.append(" ...\n"); <END> } }); throw new IllegalStateException(message.toString()); } Score workingScore = calculateScore(); if (!expectedWorkingScore.equals(workingScore)) { assertWorkingScoreFromScratch(workingScore, "assertShadowVariablesAreNotStale(" + expectedWorkingScore + ", " + completedAction + ")"); throw new IllegalStateException("Impossible " + VariableListener.class.getSimpleName() + " corruption (" + expectedWorkingScore.subtract(workingScore).toShortString() + "):" + " the expectedWorkingScore (" + expectedWorkingScore + ") is not the workingScore (" + workingScore + ") after all " + VariableListener.class.getSimpleName() + "s were triggered without changes to the genuine variables" + " after completedAction (" + completedAction + ").\n" + "But all the shadow variable values are still the same, so this is impossible.\n" + "Maybe run with " + EnvironmentMode.FULL_ASSERT + " if you aren't already, to fail earlier."); } }</code><technical_language>Is a reason show violation? information violations is missing, comparing buildShadowVariableAnalysis</technical_language>

Target:
public void assertShadowVariablesAreNotStale(Score expectedWorkingScore, Object completedAction) { String violationMessage = createShadowVariablesViolationMessage(); if (violationMessage != null) { throw new IllegalStateException( VariableListener.class.getSimpleName() + " corruption after completedAction (" + completedAction + "):\n" + violationMessage); } Score workingScore = calculateScore(); if (!expectedWorkingScore.equals(workingScore)) { assertWorkingScoreFromScratch(workingScore, "assertShadowVariablesAreNotStale(" + expectedWorkingScore + ", " + completedAction + ")"); throw new IllegalStateException("Impossible " + VariableListener.class.getSimpleName() + " corruption (" + expectedWorkingScore.subtract(workingScore).toShortString() + "):" + " the expectedWorkingScore (" + expectedWorkingScore + ") is not the workingScore (" + workingScore + ") after all " + VariableListener.class.getSimpleName() + "s were triggered without changes to the genuine variables" + " after completedAction (" + completedAction + ").\n" + "But all the shadow variable values are still the same, so this is impossible.\n" + "Maybe run with " + EnvironmentMode.FULL_ASSERT + " if you aren't already, to fail earlier."); } }
Source:
<code>protected <T> T parseResponseStreamAndClose(InputStream inputStream, Class<T> clazz) throws IOException { try (InputStreamReader reader = new InputStreamReader(inputStream)) { T objectFromJson = GSON.fromJson(reader, clazz); if (objectFromJson == null) { LOG.error( "Response doesn't contain any data, though it was expected to contain some."); throw new IOException( <START> "Internal server error. Unexpected response body received."); <END> } return objectFromJson; } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } }</code><technical_language>I empty response body more accurate message</technical_language>

Target:
protected <T> T parseResponseStreamAndClose(InputStream inputStream, Class<T> clazz) throws IOException { try (InputStreamReader reader = new InputStreamReader(inputStream)) { T objectFromJson = GSON.fromJson(reader, clazz); if (objectFromJson == null) { throw new IOException( "Internal server error. Unexpected response body received from Feature API."); } return objectFromJson; } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } }
Source:
<code><START> public static Set<Flag> addFlag(Set<Flag> flags, Flag newFlag) { <END> if (flags == null) { return EnumSet.of(newFlag); } if (flags.contains(newFlag)) { return flags; } EnumSet<Flag> copy = EnumSet.copyOf(flags); copy.add(newFlag); return copy; }</code><technical_language>+1: this is a lot nicer</technical_language>

Target:
public static Set<Flag> addFlag(Set<Flag> flags, Flag newFlag) { if (flags == null || flags.isEmpty()) { return EnumSet.of(newFlag); } if (flags.contains(newFlag)) { return flags; } EnumSet<Flag> copy = EnumSet.copyOf(flags); copy.add(newFlag); return copy; }
Source:
<code>public void testFavoriteBranchCleanup() throws Exception { Assert.assertFalse(joeSmith.isFavoriteBranch(saw1Branch)); Assert.assertFalse(joeSmith.isFavoriteBranch(saw2Branch)); Assert.assertEquals(0, joeSmith.getAttributeCount(CoreAttributeTypes.FavoriteBranch)); <START> joeSmith.addAttribute(CoreAttributeTypes.FavoriteBranch, String.valueOf(saw1Branch.getUuid())); <END> joeSmith.addAttribute(CoreAttributeTypes.FavoriteBranch, String.valueOf(saw1Branch.getUuid())); joeSmith.persist(getClass().getSimpleName() + " - testFavoriteBranchCleanup"); Assert.assertEquals(2, joeSmith.getAttributeCount(CoreAttributeTypes.FavoriteBranch)); Assert.assertTrue(joeSmith.isFavoriteBranch(saw1Branch)); joeSmith.toggleFavoriteBranch(saw1Branch); Assert.assertFalse(joeSmith.isDirty()); Assert.assertFalse(joeSmith.isFavoriteBranch(saw1Branch)); Assert.assertEquals(0, joeSmith.getAttributeCount(CoreAttributeTypes.FavoriteBranch)); }</code><technical_language>line is a repeat</technical_language>

Target:
public void testFavoriteBranchCleanup() throws Exception { assertFalse(joeSmith.isFavoriteBranch(saw1Branch)); assertFalse(joeSmith.isFavoriteBranch(saw2Branch)); assertEquals(0, joeSmith.getAttributeCount(CoreAttributeTypes.FavoriteBranch)); joeSmith.addAttribute(CoreAttributeTypes.FavoriteBranch, String.valueOf(saw1Branch.getUuid())); joeSmith.addAttribute(CoreAttributeTypes.FavoriteBranch, String.valueOf(saw1Branch.getUuid())); joeSmith.persist(testInfo.getTestName() + " - testFavoriteBranchCleanup"); assertEquals(2, joeSmith.getAttributeCount(CoreAttributeTypes.FavoriteBranch)); assertTrue(joeSmith.isFavoriteBranch(saw1Branch)); joeSmith.toggleFavoriteBranch(saw1Branch); assertFalse(joeSmith.isDirty()); assertFalse(joeSmith.isFavoriteBranch(saw1Branch)); assertEquals(0, joeSmith.getAttributeCount(CoreAttributeTypes.FavoriteBranch)); }