auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void id3EnergyWiriter() { try { String res = averageEnergy + "-" + inTransitionTimes.toString() + "-" + outTransitionTimes.toString(); <START> tag.deleteField("TXXX"); <END> FrameBodyTXXX txxxBody = new FrameBodyTXXX(); txxxBody.setDescription("Average Energy and into and outro transitions"); txxxBody.setText(res); AbstractID3v2Frame frame = null; if (tag instanceof ID3v23Tag) { frame = new ID3v23Frame("TXXX"); } else if (tag instanceof ID3v24Tag) { frame = new ID3v24Frame("TXXX"); } frame.setBody(txxxBody); tag.setField(frame); song.setTag(tag); song.commit(); tag = song.getID3v2Tag(); } catch (FieldDataInvalidException | CannotWriteException e) { log.error("Error in Track while writing energyLevels to ID3"); log.trace(StackTrace.stackTrace(e)); } }</code><technical_language>this tag is times, put in a final variable? (not hardcode methods)</technical_language>

Target:
public void id3EnergyWiriter() { try { String res = averageEnergy + "/" + differences.toString(); tag.deleteField(customWriteTag); FrameBodyTXXX txxxBody = new FrameBodyTXXX(); txxxBody.setDescription("Average Energy and into and outro transitions"); txxxBody.setText(res); AbstractID3v2Frame frame = null; if (tag instanceof ID3v23Tag) { frame = new ID3v23Frame(customWriteTag); } else if (tag instanceof ID3v24Tag) { frame = new ID3v24Frame(customWriteTag); } frame.setBody(txxxBody); tag.setField(frame); song.setTag(tag); song.commit(); tag = song.getID3v2Tag(); } catch (FieldDataInvalidException | CannotWriteException e) { log.error("Error in Track while writing energyLevels to ID3"); log.trace(StackTrace.stackTrace(e)); } }
Source:
<code>public static void setObjectRetention_test1() throws Exception { String methodName = "setObjectRetention(SetObjectRetentionArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName); } long startTime = System.currentTimeMillis(); String bucketName = getRandomName(); String objectName = getRandomName(); try { client.makeBucket(MakeBucketArgs.builder().bucket(bucketName).objectLock(true).build()); try { ZonedDateTime retentionUntil = ZonedDateTime.now(Time.UTC).plusDays(1).withNano(0); Retention expectedConfig = new Retention(RetentionMode.GOVERNANCE, retentionUntil); <START> try (final InputStream is = new ContentInputStream(1 * KB)) { <END> PutObjectOptions options = new PutObjectOptions(1 * KB, -1); options.setContentType(customContentType); client.putObject(bucketName, objectName, is, options); } client.setObjectRetention( SetObjectRetentionArgs.builder() .bucket(bucketName) .object(objectName) .config(expectedConfig) .build()); Retention emptyConfig = new Retention(); client.setObjectRetention( SetObjectRetentionArgs.builder() .bucket(bucketName) .object(objectName) .config(emptyConfig) .bypassGovernanceMode(true) .build()); } finally { client.removeObject( RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); client.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build()); } mintSuccessLog(methodName, null, startTime); } catch (Exception e) { handleException(methodName, null, startTime, e); } }</code><technical_language>required close ContentInputStream</technical_language>

Target:
public static void setObjectRetention_test1() throws Exception { String methodName = "setObjectRetention(SetObjectRetentionArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName); } long startTime = System.currentTimeMillis(); String bucketName = getRandomName(); String objectName = getRandomName(); try { client.makeBucket(MakeBucketArgs.builder().bucket(bucketName).objectLock(true).build()); try { client.putObject( bucketName, objectName, new ContentInputStream(1 * KB), new PutObjectOptions(1 * KB, -1)); ZonedDateTime retentionUntil = ZonedDateTime.now(Time.UTC).plusDays(1); Retention expectedConfig = new Retention(RetentionMode.GOVERNANCE, retentionUntil); client.setObjectRetention( SetObjectRetentionArgs.builder() .bucket(bucketName) .object(objectName) .config(expectedConfig) .build()); Retention emptyConfig = new Retention(); client.setObjectRetention( SetObjectRetentionArgs.builder() .bucket(bucketName) .object(objectName) .config(emptyConfig) .bypassGovernanceMode(true) .build()); } finally { client.removeObject( RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); client.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build()); } mintSuccessLog(methodName, null, startTime); } catch (Exception e) { handleException(methodName, null, startTime, e); } }
Source:
<code>public QueryResponse process(QueryResponse input) throws PluginExecutionException, StopProcessingException { LOGGER.trace("ENTERING: process (for PostFederatedQueryPlugin)"); if (null != input) { Set<ProcessingDetails> processingDetails = input.getProcessingDetails(); List<Result> results = input.getResults(); Iterator<ProcessingDetails> iterator = processingDetails.iterator(); while (iterator.hasNext()) { ProcessingDetails next = iterator.next(); if (next != null && next.getException() != null) { String sourceId = next.getSourceId(); updateMetric(sourceId, EXCEPTIONS_SCOPE, 1); } } Map<String, Integer> totalHitsPerSource = new HashMap<String, Integer>(); for (Result result : results) { String sourceId = result.getMetacard().getSourceId(); if (totalHitsPerSource.containsKey(sourceId)) { totalHitsPerSource.put(sourceId, totalHitsPerSource.get(sourceId) + 1); } else { totalHitsPerSource.put(sourceId, 1); } } for (Map.Entry<String, Integer> source : totalHitsPerSource.entrySet()) { updateMetric(source.getKey(), QUERIES_TOTAL_RESULTS_SCOPE, source.getValue()); } <START> for (Map.Entry<String, Serializable> property : input.getProperties().entrySet()) { <END> String key = property.getKey(); if (key.startsWith(METRICS_SOURCE_ELAPSED)) { String source = key.substring(METRICS_SOURCE_ELAPSED.length()); updateMetric(source, QUERIES_LATENCY_SCOPE, (int) property.getValue()); } } } LOGGER.trace("EXITING: process (for PostFederatedQueryPlugin)"); return input; }</code><technical_language>I suggest pulling this loop out a private updateSourceLatencyMetrics method process method more focused</technical_language>

Target:
public QueryResponse process(QueryResponse input) throws PluginExecutionException, StopProcessingException { LOGGER.trace("ENTERING: process (for PostFederatedQueryPlugin)"); if (null != input) { Set<ProcessingDetails> processingDetails = input.getProcessingDetails(); List<Result> results = input.getResults(); updateExceptionsMetric(processingDetails); updateTotalHitsMetric(results); updateLatencyMetric(input); } LOGGER.trace("EXITING: process (for PostFederatedQueryPlugin)"); return input; }
Source:
<code>public void run() { <START> count--; <END> AbstractContributionItem[] copy = itemsToUpdateLater.toArray(new AbstractContributionItem[] {}); itemsToUpdateLater.clear(); for (AbstractContributionItem it : copy) { it.updateItemEnablement(); } }</code><technical_language>- set zero</technical_language>

Target:
public void run() { count = 0; AbstractContributionItem[] copy = itemsToUpdateLater.toArray(new AbstractContributionItem[] {}); itemsToUpdateLater.clear(); for (AbstractContributionItem it : copy) { it.updateItemEnablement(); } }
Source:
<code>public int readUnsignedByte() { <START> byte b; <END> if (bitOffset != 0) { b = (byte) ((data[byteOffset] << bitOffset) | ((data[byteOffset + 1] & 0xFF) >> (8 - bitOffset))); } else { b = data[byteOffset]; } byteOffset++; return b & 0xFF; }</code><technical_language>way, problem shift is signed. data[byteOffset+1] is cast byte int shift happens. If byte is negative, cast more adding zeros front. fix is correct, I feel method written more (and unnecessary int->byte->int conversion), like: public int readUnsignedByte() { int value; if (bitOffset != 0) { = ((data[byteOffset] & 0xFF) << bitOffset) | ((data[byteOffset + 1] & 0xFF) >>> (8 - bitOffset)); } else { = data[byteOffset] & 0xFF; } byteOffset++; return value; } Thoughts? Happy for amend change do this, I submit separately</technical_language>

Target:
public int readUnsignedByte() { int value; if (bitOffset != 0) { value = (data[byteOffset] << bitOffset) | ((data[byteOffset + 1] & 0xFF) >>> (8 - bitOffset)); } else { value = data[byteOffset]; } byteOffset++; return value & 0xFF; }
Source:
<code>public void testFileSystemInaccessible() throws Exception { File inaccessibleDir = null; boolean tcSuccessfull = true; try { String dirPath = getContext().getFilesDir() + File.separator + "inaccessible"; inaccessibleDir = new File(dirPath); inaccessibleDir.mkdir(); final FileRotator rotate = new FileRotator( inaccessibleDir, PREFIX, SECOND_IN_MILLIS, SECOND_IN_MILLIS); <START> Libcore.os.chmod(inaccessibleDir.getPath(), 0); <END> rotate.maybeRotate(TEST_TIME); } catch (Exception e) { tcSuccessfull = false; } assertTrue("unable to delete directory", inaccessibleDir.delete()); assertTrue("test failed with an exception", tcSuccessfull); }</code><technical_language>surface a permissions issue, directory mkdir'ed yet. enough test a directory exist</technical_language>

Target:
public void testFileSystemInaccessible() throws Exception { File inaccessibleDir = null; String dirPath = getContext().getFilesDir() + File.separator + "inaccessible"; inaccessibleDir = new File(dirPath); final FileRotator rotate = new FileRotator(inaccessibleDir, PREFIX, SECOND_IN_MILLIS, SECOND_IN_MILLIS); rotate.maybeRotate(TEST_TIME); }
Source:
<code>public void withProfvis(String userAction, final Command command) { withDependencies( "Preparing Profiler", userAction, <START> profvisDependenciesArray(), <END> false, new CommandWithArg<Boolean>() { @Override public void execute(Boolean succeeded) { if (succeeded) command.execute(); } } ); }</code><technical_language>declare inline array (the helper methods for scenarios want re-use lists of dependencies). For example: <LINK_0></technical_language>

Target:
public void withProfvis(String userAction, final Command command) { withDependencies( "Preparing Profiler", userAction, new Dependency[] { Dependency.embeddedPackage("profvis") }, false, new CommandWithArg<Boolean>() { @Override public void execute(Boolean succeeded) { if (succeeded) command.execute(); } } ); }
Source:
<code>public void execute(URI uri, final ConnectionCallback connectionCallback) { final boolean isSsl = "https".equalsIgnoreCase(uri.getScheme()); int port = uri.getPort(); if (port < 0) { if (isSsl) { port = 443; } else { port = 80; } } final InetSocketAddress remoteAddress = new InetSocketAddress(uri.getHost(), port); if (enablePooling) { ListenableFuture<?> acquireFuture = connectionPermits.acquire(); acquireFuture.addListener(new Runnable() { @Override public void run() { connectionPermitAcquired(isSsl, remoteAddress, connectionCallback); } }, executor); } else { <START> ChannelFuture future = bootstrap.connect(remoteAddress); <END> if (isSsl) { future.addListener(new SslConnectionListener(remoteAddress, connectionCallback, openChannels)); } else { future.addListener(new CallbackConnectionListener(remoteAddress, connectionCallback, openChannels)); } } }</code><technical_language>This block is duplicated below, extract a method</technical_language>

Target:
public void execute(URI uri, final ConnectionCallback connectionCallback) { final boolean isSsl = "https".equalsIgnoreCase(uri.getScheme()); int port = uri.getPort(); if (port < 0) { if (isSsl) { port = 443; } else { port = 80; } } final InetSocketAddress remoteAddress = new InetSocketAddress(uri.getHost(), port); if (enablePooling) { ListenableFuture<?> acquireFuture = connectionPermits.acquire(); acquireFuture.addListener(new Runnable() { @Override public void run() { connectionPermitAcquired(isSsl, remoteAddress, connectionCallback); } }, executor); } else { openConnecton(isSsl, remoteAddress, connectionCallback); } }
Source:
<code>public void init() { <START> this.context.register(BatchConfiguration.class); <END> this.context.refresh(); JobRepository jobRepository = this.context.getBean(JobRepository.class); JobLauncher jobLauncher = this.context.getBean(JobLauncher.class); this.jobs = new JobBuilderFactory(jobRepository); PlatformTransactionManager transactionManager = this.context .getBean(PlatformTransactionManager.class); this.steps = new StepBuilderFactory(jobRepository, transactionManager); Tasklet tasklet = (contribution, chunkContext) -> null; this.step = this.steps.get("step").tasklet(tasklet).build(); this.job = this.jobs.get("job").start(this.step).build(); this.jobExplorer = this.context.getBean(JobExplorer.class); this.runner = new TaskJobLauncherCommandLineRunner(jobLauncher, this.jobExplorer); this.context.getBean(BatchConfiguration.class).clear(); }</code><technical_language>@ContextConfiguration instead of wiring this ourselves</technical_language>

Target:
public void init() { this.jobs = new JobBuilderFactory(this.jobRepository); this.steps = new StepBuilderFactory(this.jobRepository, this.transactionManager); Tasklet tasklet = (contribution, chunkContext) -> null; this.step = this.steps.get("step").tasklet(tasklet).build(); this.job = this.jobs.get("job").start(this.step).build(); this.runner = new TaskJobLauncherCommandLineRunner(this.jobLauncher, this.jobExplorer); }
Source:
<code>public int cancel () { if (parent() != null) parent().removeChildAction(this); int outcome; <START> synchronized (_cancelLock) { END> if (TxStats.enabled() && running()) TxStats.getInstance().incrementApplicationRollbacks(); outcome = super.Abort(); } if (outcome == ActionStatus.ABORTED) { afterCompletion(outcome); } return outcome; }</code><technical_language>I another lock in here. put conditional stat increment in BasicAction::Abort is synchronized</technical_language>

Target:
public int cancel () { if (parent() != null) parent().removeChildAction(this); int outcome = super.Abort(true); if (outcome == ActionStatus.ABORTED) { afterCompletion(outcome); } return outcome; }
Source:
<code>public void onResetClusterEmulatedMachine() { ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } ArrayList<VdcActionParametersBase> prms = new ArrayList<VdcActionParametersBase>(); <START> for (Object vdsGroup : getSelectedItems()) <END> { ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(((VDSGroup) vdsGroup)); currentParam.setForceResetEmulatedMachine(true); prms.add(currentParam); } model.startProgress(null); Frontend.getInstance().runMultipleAction(VdcActionType.UpdateVdsGroup, prms, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); } }, model); }</code><technical_language>I ClusterListModel is generic getSelectedItems() return VDSGroup collection. Object + casts is unnecessary</technical_language>

Target:
public void onResetClusterEmulatedMachine() { final ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } ArrayList<VdcActionParametersBase> prms = new ArrayList<VdcActionParametersBase>(); for (VDSGroup vdsGroup : getSelectedItems()) { ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(((VDSGroup) vdsGroup)); currentParam.setForceResetEmulatedMachine(true); prms.add(currentParam); } model.startProgress(null); Frontend.getInstance().runMultipleAction(VdcActionType.UpdateVdsGroup, prms, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { model.stopProgress(); cancel(); } }); }
Source:
<code>public static void getPresignedObjectUrl_test4() throws Exception { String methodName = "getPresignedObjectUrl(GetPresignedObjectUrlArgs args)"; if (!mintEnv) { System.out.println("Test: presigned put object: " + methodName); } long startTime = System.currentTimeMillis(); try { String objectName = getRandomName(); String urlString = client.getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.PUT) .bucket(bucketName) .object(objectName) .build()); byte[] data = "hello, world".getBytes(StandardCharsets.UTF_8); writeObject(urlString, data); client.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); mintSuccessLog(methodName, "presigned put object", startTime); } catch (Exception e) { <START> handleException(methodName, "presigned put object", startTime, e); <END> } }</code><technical_language>argument sense for args</technical_language>

Target:
public static void getPresignedObjectUrl_test4() throws Exception { String methodName = "getPresignedObjectUrl(GetPresignedObjectUrlArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName + " presigned put"); } long startTime = System.currentTimeMillis(); try { String objectName = getRandomName(); String urlString = client.getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.PUT) .bucket(bucketName) .object(objectName) .build()); byte[] data = "hello, world".getBytes(StandardCharsets.UTF_8); writeObject(urlString, data); client.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); mintSuccessLog(methodName, null, startTime); } catch (Exception e) { handleException(methodName, null, startTime, e); } }
Source:
<code>public void testGetResources() throws Exception { <START> URL testJar = ZipUtilsTest.class.getResource("/codenvy/codenvy.jar"); <END> @SuppressWarnings("unchecked") Consumer<InputStream> consumer = mock(Consumer.class); ZipUtils.getResources(new ZipFile(testJar.getFile()), Pattern.compile(".*[ verify(consumer, times(2)).accept(any(InputStream.class)); }</code><technical_language>rename /che/che.jar</technical_language>

Target:
public void testGetResources() throws Exception { URL testJar = ZipUtilsTest.class.getResource("/che/che.jar"); @SuppressWarnings("unchecked") Consumer<InputStream> consumer = mock(Consumer.class); ZipUtils.getResources(new ZipFile(testJar.getFile()), Pattern.compile(".*[ verify(consumer, times(2)).accept(any(InputStream.class)); }
Source:
<code>public WorkspaceImpl create(WorkspaceImpl workspace) throws ConflictException, ServerException { requireNonNull(workspace, "Required non-null workspace"); try { doCreate(workspace); eventService.publish(new WorkspaceCreatedEvent(workspace)); <START> } catch (DuplicateKeyException dkEx) { <END> throw new ConflictException(format("Workspace with id '%s' or name '%s' in namespace '%s' already exists", workspace.getId(), workspace.getConfig().getName(), workspace.getNamespace())); } catch (RuntimeException x) { throw new ServerException(x.getMessage(), x); } return new WorkspaceImpl(workspace); }</code><technical_language>do in DAO? In case reach subscribers manager ends execution of method called DAO</technical_language>

Target:
public WorkspaceImpl create(WorkspaceImpl workspace) throws ConflictException, ServerException { requireNonNull(workspace, "Required non-null workspace"); try { doCreate(workspace); } catch (DuplicateKeyException dkEx) { throw new ConflictException(format("Workspace with id '%s' or name '%s' in namespace '%s' already exists", workspace.getId(), workspace.getConfig().getName(), workspace.getNamespace())); } catch (RuntimeException x) { throw new ServerException(x.getMessage(), x); } return new WorkspaceImpl(workspace); }
Source:
<code>protected void validateExpression() throws IllegalArgumentException { DayOfMonthExpressionPart domPart = (DayOfMonthExpressionPart) getExpressionPart(DayOfMonthExpressionPart.class); DayOfWeekExpressionPart dowPart = (DayOfWeekExpressionPart) getExpressionPart(DayOfWeekExpressionPart.class); if (domPart.isNotSpecific() && dowPart.isNotSpecific()) { throw new IllegalArgumentException( "The DayOfMonth and DayOfWeek rule parts CAN NOT be not specific at the same time."); } YearsExpressionPart yearsPart = (YearsExpressionPart) getExpressionPart(YearsExpressionPart.class); if (yearsPart == null) { List<@NonNull CronExpressionPart> ep = getExpressionParts(); List<@NonNull CronExpressionPart> parts = new LinkedList<@NonNull CronExpressionPart>(); parts.addAll(ep); try { parts.add(new YearsExpressionPart("*")); } catch (ParseException e) { <START> throw new IllegalArgumentException("Year rule part can contain * as a token"); <END> } setExpressionParts(parts); } }</code><technical_language>~~can~~ -></technical_language>

Target:
protected void validateExpression() throws IllegalArgumentException { DayOfMonthExpressionPart domPart = (DayOfMonthExpressionPart) getExpressionPart(DayOfMonthExpressionPart.class); DayOfWeekExpressionPart dowPart = (DayOfWeekExpressionPart) getExpressionPart(DayOfWeekExpressionPart.class); if (domPart.isNotSpecific() && dowPart.isNotSpecific()) { throw new IllegalArgumentException( "The DayOfMonth and DayOfWeek rule parts CAN NOT be not specific at the same time."); } YearsExpressionPart yearsPart = (YearsExpressionPart) getExpressionPart(YearsExpressionPart.class); if (yearsPart == null) { List<@NonNull CronExpressionPart> ep = getExpressionParts(); List<@NonNull CronExpressionPart> parts = new LinkedList<@NonNull CronExpressionPart>(); parts.addAll(ep); try { parts.add(new YearsExpressionPart("*")); } catch (ParseException e) { throw new IllegalArgumentException("Year rule part must contain * as a token"); } setExpressionParts(parts); } }
Source:
<code>public Collection<String> expectedQueueNames() { this.isListener = true; Collection<String> replyQueue = null; if (this.replyAddress != null) { Address address = new Address(this.replyAddress); if ("".equals(address.getExchangeName())) { replyQueue = Collections.singletonList(address.getRoutingKey()); } else { <START> logger.debug("Cannot verify reply queue because it has the form 'exchange/routingKey'"); <END> } } else if (this.replyAddress == null || this.replyAddress.equals(Address.AMQ_RABBITMQ_REPLY_TO)) { throw new IllegalStateException("A listener container must not be provided when using direct reply-to"); } return replyQueue; }</code><technical_language>for this info. I Address is in form exchange/routingKey</technical_language>

Target:
public Collection<String> expectedQueueNames() { this.isListener = true; Collection<String> replyQueue = null; if (this.replyAddress == null || this.replyAddress.equals(Address.AMQ_RABBITMQ_REPLY_TO)) { throw new IllegalStateException("A listener container must not be provided when using direct reply-to"); } else if (this.replyAddress != null) { Address address = new Address(this.replyAddress); if ("".equals(address.getExchangeName())) { replyQueue = Collections.singletonList(address.getRoutingKey()); } else { logger.info("Cannot verify reply queue because 'replyAddress' is not a simple queue name: " + this.replyAddress); } } return replyQueue; }
Source:
<code>public void shouldMoveDocsToColdStorage() throws OperationException, IOException { ACE[] aces = { new ACE("linda", SecurityConstants.READ, true), new ACE("linda", SecurityConstants.WRITE, true), new ACE("linda", SecurityConstants.WRITE_COLD_STORAGE, true) }; List<DocumentModel> documents = List.of(createFileDocument(session, true, "MyFile1", aces), createFileDocument(session, true, "MyFile2", aces), createFileDocument(session, true, "MyFile3", aces)); try (CloseableCoreSession userSession = CoreInstance.openCoreSession(session.getRepositoryName(), "linda")) { moveContentToColdStorage(userSession, documents); } <START> documents = List.of(createFileDocument(session, true, "MyFile4", aces), createFileDocument(session, true, "MyFile5", aces), createFileDocument(session, true, "MyFile6", aces)); <END> moveContentToColdStorage(session, documents); }</code><technical_language>good point thanks, wrong copy /</technical_language>

Target:
public void shouldMoveDocsToColdStorage() throws OperationException, IOException { ACE[] aces = { new ACE("linda", SecurityConstants.READ, true), new ACE("linda", SecurityConstants.WRITE, true), new ACE("linda", SecurityConstants.WRITE_COLD_STORAGE, true) }; List<DocumentModel> documents = List.of(createFileDocument(session, true, aces), createFileDocument(session, true, aces), createFileDocument(session, true, aces)); try (CloseableCoreSession userSession = CoreInstance.openCoreSession(session.getRepositoryName(), "linda")) { moveContentToColdStorage(userSession, documents); } documents = List.of(createFileDocument(session, true), createFileDocument(session, true), createFileDocument(session, true)); moveContentToColdStorage(session, documents); }
Source:
<code>public Iterator<List<CandidateCellForSweeping>> getCandidateCellsForSweeping( TableReference tableRef, CandidateCellForSweepingRequest request, ConsistencyLevel consistencyLevel) { Iterator<List<CassandraRawCellValue>> rawIter = cellPager.createCellIterator( tableRef, request.startRowInclusive(), <START> request.batchSizeHint().orElse(100), <END> consistencyLevel); return new CellGroupingIterator(rawIter, request); }</code><technical_language>This broken out a named constant scared set this batch hint, I traced of codepaths create CandidateCellForSweepRequests I promising, I imagine 100 pretty safe unnecessarily slow for wide-row dynamic column rows small cells</technical_language>

Target:
public Iterator<List<CandidateCellForSweeping>> getCandidateCellsForSweeping( TableReference tableRef, CandidateCellForSweepingRequest request, ConsistencyLevel consistencyLevel) { Iterator<List<CassandraRawCellValue>> rawIter = cellPager.createCellIterator( tableRef, request.startRowInclusive(), request.batchSizeHint().orElse(AtlasDbConstants.DEFAULT_SWEEP_CANDIDATE_BATCH_HINT), consistencyLevel); return new CellGroupingIterator(rawIter, request); }
Source:
<code>public void testListRules() { List<FirewallRule> firewalls = firewallApi().getRuleList(dataCenter.id(), testServer.id(), testNic.id()); assertNotNull(firewalls); assertFalse(firewalls.isEmpty()); <START> assertEquals(firewalls.size(), 1); <END> }</code><technical_language>Assert list contains created element, instead of verifying size</technical_language>

Target:
public void testListRules() { List<FirewallRule> firewalls = firewallApi().list(dataCenter.id(), testServer.id(), testNic.id()); assertNotNull(firewalls); assertFalse(firewalls.isEmpty()); assertTrue(Iterables.any(firewalls, new Predicate<FirewallRule>() { @Override public boolean apply(FirewallRule input) { return input.id().equals(testFirewallRule.id()); } })); }
Source:
<code>public AddVmParameters(VmStatic vmStatic) { <START> super(vmStatic); <END> }</code><technical_language>please initialization of diskInfoList, fix getter.</technical_language>

Target:
public AddVmParameters(VmStatic vmStatic) { super(vmStatic); diskInfoList = new ArrayList<DiskImage>(); }
Source:
<code>public void beginTask(String name, int totalWork) { fTaskName = name; fSubTaskName = ""; updateLabel(); if ((totalWork == IProgressMonitor.UNKNOWN || totalWork == 0) && !fProgressIndicator.isDisposed()) { fProgressIndicator.beginAnimatedTask(); } else { <START> fProgressIndicator.beginTask(totalWork); <END> } if (fToolBar != null && !fToolBar.isDisposed()) { fToolBar.setVisible(true); fToolBar.setFocus(); } }</code><technical_language>access thiss if indicator is disposed? This fail other if branch</technical_language>

Target:
public void beginTask(String name, int totalWork) { fTaskName = name; fSubTaskName = ""; updateLabel(); if (!fProgressIndicator.isDisposed()) { if (totalWork == IProgressMonitor.UNKNOWN || totalWork == 0) { fProgressIndicator.beginAnimatedTask(); } else { fProgressIndicator.beginTask(totalWork); } } if (fToolBar != null && !fToolBar.isDisposed()) { fToolBar.setVisible(true); fToolBar.setFocus(); } }
Source:
<code>static ChannelStateByteBuffer wrap(BufferBuilder bufferBuilder) { final byte[] buf = new byte[1024]; return new ChannelStateByteBuffer() { @Override public boolean isWritable() { return !bufferBuilder.isFull(); } @Override public int writableBytes() { return bufferBuilder.writableBytes(); } @Override <START> public int writeBytes(InputStream input, int upToBytes) throws IOException { <END> int left = upToBytes; for (int toRead = getToRead(left); toRead > 0; toRead = getToRead(left)) { int read = input.read(buf, 0, toRead); int copied = bufferBuilder.append(java.nio.ByteBuffer.wrap(buf, 0, read)); Preconditions.checkState(copied == read); left -= read; } bufferBuilder.commit(); return upToBytes - left; } private int getToRead(int bytesToRead) { return min(bytesToRead, min(buf.length, writableBytes())); } }; }</code><technical_language>upToBytes -> bytesToRead consistent ChannelStateByteBuffer wrap(Buffer buffer)</technical_language>

Target:
static ChannelStateByteBuffer wrap(BufferBuilder bufferBuilder) { final byte[] buf = new byte[1024]; return new ChannelStateByteBuffer() { @Override public boolean isWritable() { return !bufferBuilder.isFull(); } @Override public int writeBytes(InputStream input, int bytesToRead) throws IOException { int left = bytesToRead; for (int toRead = getToRead(left); toRead > 0; toRead = getToRead(left)) { int read = input.read(buf, 0, toRead); int copied = bufferBuilder.append(java.nio.ByteBuffer.wrap(buf, 0, read)); Preconditions.checkState(copied == read); left -= read; } bufferBuilder.commit(); return bytesToRead - left; } private int getToRead(int bytesToRead) { return min(bytesToRead, min(buf.length, bufferBuilder.getWritableBytes())); } }; }
Source:
<code>private void setupRecyclerView(List<Layer> layers) { mLayersAdapter = new LayersAdapter(this); mLayersRecyclerView.setAdapter(mLayersAdapter); for (Layer layer : layers) { if (layer.canShowInLegend()) { layer.addDoneLoadingListener(() -> { <START> mLayersAdapter.addLayer(layer); <END> }); layer.loadAsync(); } } }</code><technical_language>line</technical_language>

Target:
private void setupRecyclerView(List<Layer> layers) { mLayersAdapter = new LayersAdapter(this); mLayersRecyclerView.setAdapter(mLayersAdapter); for (Layer layer : layers) { if (layer.canShowInLegend()) { layer.addDoneLoadingListener(() -> mLayersAdapter.addLayer(layer)); layer.loadAsync(); } } }
Source:
<code><START> private static boolean isCalled(final int totalDepth, final int altDepth, final double sumOfAltQualities, final double alleleFraction, final double logOddsThreshold) { <END> final double threshold = 10.0 * (altDepth * -Math.log10(alleleFraction) + (totalDepth - altDepth) * -Math.log10(1.0 - alleleFraction) + logOddsThreshold); return sumOfAltQualities > threshold; }</code><technical_language>this protected tested directly</technical_language>

Target:
static boolean isCalled(final int totalDepth, final int altDepth, final double sumOfAltQualities, final double alleleFraction, final double logOddsThreshold) { final double threshold = 10.0 * (altDepth * -Math.log10(alleleFraction) + (totalDepth - altDepth) * -Math.log10(1.0 - alleleFraction) + logOddsThreshold); return sumOfAltQualities > threshold; }
Source:
<code>public void execute(SensorContext context) { List<InputFile> inputFiles = new ArrayList<>(); fileSystem.inputFiles(mainFilesPredicate).forEach(inputFiles::add); if (inputFiles.isEmpty()) { return; } ProgressReport progressReport = new ProgressReport("Report about progress of XML analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(inputFiles.stream().map(InputFile::toString).collect(Collectors.toList())); <START> boolean successfullyCompleted = false; <END> boolean cancelled = false; try { for (InputFile inputFile : inputFiles) { if (context.isCancelled()) { cancelled = true; break; } scanFile(context, inputFile); progressReport.nextFile(); } successfullyCompleted = !cancelled; } finally { if (successfullyCompleted) { progressReport.stop(); } else { progressReport.cancel(); } } }</code><technical_language>booleans linked. of them</technical_language>

Target:
public void execute(SensorContext context) { List<InputFile> inputFiles = new ArrayList<>(); fileSystem.inputFiles(mainFilesPredicate).forEach(inputFiles::add); if (inputFiles.isEmpty()) { return; } ProgressReport progressReport = new ProgressReport("Report about progress of XML analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(inputFiles.stream().map(InputFile::toString).collect(Collectors.toList())); boolean cancelled = false; try { for (InputFile inputFile : inputFiles) { if (context.isCancelled()) { cancelled = true; break; } scanFile(context, inputFile); progressReport.nextFile(); } } finally { if (!cancelled) { progressReport.stop(); } else { progressReport.cancel(); } } }
Source:
<code>public ByteBuf writeRequest(final ByteBufAllocator alloc, final ByteBuffer dst) { <START> writeBinaryHeader(dst, OpCode.FLUSH, 0, 4, 4, 0, opaque); <END> if (delay >= 0) { dst.putInt(delay); } return toBuffer(alloc, dst); }</code><technical_language>extraLength 0 4 I guess, depending of delay</technical_language>

Target:
public ByteBuf writeRequest(final ByteBufAllocator alloc, final ByteBuffer dst) { writeBinaryHeader(dst, OpCode.FLUSH, 0, 4, 4, 0, opaque); dst.putInt(delay); return toBuffer(alloc, dst); }
Source:
<code>public void testTaskWithDisableAutoClaimTaskWithGroupOnly() throws Exception { TestWorkItemManager manager = new TestWorkItemManager(); <START> env.set("Autoclaim", new String("false")); <END> ksession.setEnvironment(env); ksession.setWorkItemManager(manager); WorkItemImpl workItem = new WorkItemImpl(); workItem.setName("Human Task"); workItem.setParameter("NodeName", "TaskName"); workItem.setParameter("Comment", "Comment"); workItem.setParameter("Priority", "10"); workItem.setParameter("GroupId", "Crusaders"); workItem.setParameter("SwimlaneActorId", "Darth Vader"); workItem.setProcessInstanceId(10); handler.executeWorkItem(workItem, manager); List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK"); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals("TaskName", task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals("Comment", task.getDescription()); assertEquals(Status.Ready, task.getStatus()); assertEquals(10, task.getProcessInstanceId().intValue()); taskService.start(task.getId(), "Darth Vader"); taskService.complete(task.getId(), "Darth Vader", null); assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME)); }</code><technical_language>I plain "false" here. is sufficient</technical_language>

Target:
public void testTaskWithDisableAutoClaimTaskWithGroupOnly() throws Exception { TestWorkItemManager manager = new TestWorkItemManager(); env.set("Autoclaim", "false"); ksession.setEnvironment(env); ksession.setWorkItemManager(manager); WorkItemImpl workItem = new WorkItemImpl(); workItem.setName("Human Task"); workItem.setParameter("NodeName", "TaskName"); workItem.setParameter("Comment", "Comment"); workItem.setParameter("Priority", "10"); workItem.setParameter("GroupId", "Crusaders"); workItem.setParameter("SwimlaneActorId", "Darth Vader"); workItem.setProcessInstanceId(10); handler.executeWorkItem(workItem, manager); List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK"); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals("TaskName", task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals("Comment", task.getDescription()); assertEquals(Status.Ready, task.getStatus()); assertEquals(10, task.getProcessInstanceId().intValue()); taskService.start(task.getId(), "Darth Vader"); taskService.complete(task.getId(), "Darth Vader", null); assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME)); }
Source:
<code>private void downloadFileUsingFTPSClient(Operation operation, String host, String ftpUserName, String ftpPassword, String savingLocation, String fileName, int serverPort, String fileDirectory) throws AndroidAgentException { FTPSClient ftpsClient = new FTPSClient(); FileOutputStream fileOutputStream = null; OutputStream outputStream = null; String response; try { ftpsClient.connect(host, serverPort); if (ftpsClient.login(ftpUserName, ftpPassword)) { ftpsClient.enterLocalPassiveMode(); ftpsClient.execPROT("P"); fileOutputStream = new FileOutputStream(savingLocation + File.separator + fileName); outputStream = new BufferedOutputStream(fileOutputStream); ftpsClient.changeWorkingDirectory(fileDirectory); if (ftpsClient.retrieveFile(fileName, outputStream)) { response = "File uploaded to the device successfully!"; operation.setStatus(resources.getString(R.string.operation_value_completed)); } else { response = "File uploaded to the device not completed."; operation.setStatus(resources.getString(R.string.operation_value_error)); } } else { <START> response = "FTP login failed."; <END> operation.setStatus(resources.getString(R.string.operation_value_error)); } operation.setOperationResponse(response); } catch (IOException e) { handleOperationError(operation, fileTransferExceptionHandler(e, fileName), e); } finally { try { if (ftpsClient.isConnected()) { ftpsClient.logout(); ftpsClient.disconnect(); } } catch (IOException ignored) { } cleanupStreams(outputStream, fileOutputStream); } }</code><technical_language>add user name error message</technical_language>

Target:
private void downloadFileUsingFTPSClient(Operation operation, String host, String ftpUserName, String ftpPassword, String savingLocation, String fileName, int serverPort, String fileDirectory) throws AndroidAgentException { FTPSClient ftpsClient = new FTPSClient(); FileOutputStream fileOutputStream = null; OutputStream outputStream = null; String response; try { ftpsClient.connect(host, serverPort); if (ftpsClient.login(ftpUserName, ftpPassword)) { ftpsClient.enterLocalPassiveMode(); ftpsClient.execPROT("P"); fileOutputStream = new FileOutputStream(savingLocation + File.separator + fileName); outputStream = new BufferedOutputStream(fileOutputStream); ftpsClient.changeWorkingDirectory(fileDirectory); if (ftpsClient.retrieveFile(fileName, outputStream)) { response = "File uploaded to the device successfully ( " + fileName + " )."; operation.setStatus(resources.getString(R.string.operation_value_completed)); } else { response = "File uploaded to the device not completed ( " + fileName + " )."; operation.setStatus(resources.getString(R.string.operation_value_error)); } } else { response = ftpUserName + " - FTP login failed."; operation.setStatus(resources.getString(R.string.operation_value_error)); } operation.setOperationResponse(response); } catch (IOException e) { handleOperationError(operation, fileTransferExceptionCause(e, fileName), e); } finally { try { if (ftpsClient.isConnected()) { ftpsClient.logout(); ftpsClient.disconnect(); } } catch (IOException ignored) { } cleanupStreams(null, outputStream, null, fileOutputStream, null, null, null, null); } }
Source:
<code><START> @Override protected ObjectPermissions getPermissions() { <END> LOG.debug("getPermissions"); return new ObjectPermissions(mAccountId, mAccountId, mBucketMode); }</code><technical_language>of codebase pattern annotation @Override is a line method definition. update of methods conform</technical_language>

Target:
protected ObjectPermissions getPermissions() { return new ObjectPermissions(mAccountId, mAccountId, mBucketMode); }
Source:
<code>public void testGetAllAssignments() throws Exception { TestHarnessBuilder builder = new TestHarnessBuilder(); Map<String, Lease> addedLeases = builder.withLease("1", WORKER_ID) .withLease("2", WORKER_ID) .withLease("3", WORKER_ID) .withLease("4", WORKER_ID) .withLease("5", WORKER_ID) .build(); coordinator.runLeaseTaker(); Collection<Lease> allAssignments = coordinator.getAllAssignments(); <START> assertEquals(allAssignments.size(), addedLeases.size()); <END> assertThat(allAssignments.containsAll(addedLeases.values()), equalTo(true)); }</code><technical_language>assertThat(..., equalTo())</technical_language>

Target:
public void testGetAllAssignments() throws Exception { TestHarnessBuilder builder = new TestHarnessBuilder(); Map<String, Lease> addedLeases = builder.withLease("1", WORKER_ID) .withLease("2", WORKER_ID) .withLease("3", WORKER_ID) .withLease("4", WORKER_ID) .withLease("5", WORKER_ID) .build(); coordinator.runLeaseTaker(); List<Lease> allLeases = coordinator.allLeases(); assertThat(allLeases.size(), equalTo(addedLeases.size())); assertThat(allLeases.containsAll(addedLeases.values()), equalTo(true)); }
Source:
<code>private static KeyEvent createNewKeyEvent(KeyEvent originalEvent) { KeyEvent newEvent = null; <START> Class c = originalEvent.getClass(); <END> if (c.equals(KeyDownEvent.class)) { newEvent = KeyDownEvent.create(originalEvent.getKey(), originalEvent.getKeyCharacter(), originalEvent.getDelta()); } else if (c.equals(KeyRepeatEvent.class)) { newEvent = KeyRepeatEvent.create(originalEvent.getKey(), originalEvent.getKeyCharacter(), originalEvent.getDelta()); } else if (c.equals(KeyUpEvent.class)) { newEvent = KeyUpEvent.create(originalEvent.getKey(), originalEvent.getKeyCharacter(), originalEvent.getDelta()); } else { logger.error("ERROR!!! Event not Identified"); } return newEvent; }</code><technical_language>Class<?> clazz is typical naming pattern for a class variable. eventClass better</technical_language>

Target:
private KeyEvent createNewKeyEvent(KeyEvent originalEvent) { KeyEvent newEvent = null; Class eventClass = originalEvent.getClass(); if (eventClass.equals(KeyDownEvent.class)) { newEvent = KeyDownEvent.create(originalEvent.getKey(), originalEvent.getKeyCharacter(), originalEvent.getDelta()); } else if (eventClass.equals(KeyRepeatEvent.class)) { newEvent = KeyRepeatEvent.create(originalEvent.getKey(), originalEvent.getKeyCharacter(), originalEvent.getDelta()); } else if (eventClass.equals(KeyUpEvent.class)) { newEvent = KeyUpEvent.create(originalEvent.getKey(), originalEvent.getKeyCharacter(), originalEvent.getDelta()); } else { logger.error("ERROR!!! Event not Identified"); } return newEvent; }
Source:
<code>public StringDataValue repeat(StringDataValue leftOperand, NumberDataValue rightOperand, StringDataValue result) throws StandardException { if (result == null) { result = (StringDataValue) getNewNull(); } if (leftOperand == null || leftOperand.isNull() || leftOperand.getString() == null) { result.setToNull(); return result; } int repeatedTimes; if (rightOperand == null || rightOperand.isNull()) { throw StandardException.newException( SQLState.LANG_INVALID_FUNCTION_ARGUMENT, "NULL", "REPEAT"); } else { try { repeatedTimes = rightOperand.getInt(); } catch (StandardException e) { throw StandardException.newException( SQLState.LANG_INVALID_FUNCTION_ARGUMENT, rightOperand, "REPEAT"); } if (repeatedTimes < 0) { throw StandardException.newException( SQLState.LANG_INVALID_FUNCTION_ARGUMENT, rightOperand, "REPEAT"); } } String val = leftOperand.getString(); <START> String concatenatedVal = null; <END> for (int i=0; i<repeatedTimes; i++) { concatenatedVal = concatenatedVal == null? val : concatenatedVal + val; } result.setValue(concatenatedVal==null?"":concatenatedVal); return result; }</code><technical_language>a StringBuilder here, recommended approach concatenate Strings together</technical_language>

Target:
public StringDataValue repeat(StringDataValue leftOperand, NumberDataValue rightOperand, StringDataValue result) throws StandardException { if (result == null) { result = (StringDataValue) getNewNull(); } if (leftOperand == null || leftOperand.isNull() || leftOperand.getString() == null) { result.setToNull(); return result; } int repeatedTimes; if (rightOperand == null || rightOperand.isNull()) { throw StandardException.newException( SQLState.LANG_INVALID_FUNCTION_ARGUMENT, "NULL", "REPEAT"); } else { try { repeatedTimes = rightOperand.getInt(); } catch (StandardException e) { throw StandardException.newException( SQLState.LANG_INVALID_FUNCTION_ARGUMENT, rightOperand, "REPEAT"); } if (repeatedTimes < 0) { throw StandardException.newException( SQLState.LANG_INVALID_FUNCTION_ARGUMENT, rightOperand, "REPEAT"); } } String val = leftOperand.getString(); StringBuilder builder = new StringBuilder(); for (int i=0; i<repeatedTimes; i++) { builder.append(val); } result.setValue(builder.toString()); return result; }
Source:
<code>public StreamSpec(String id, String physicalName, String systemName, int partitionCount, Map<String, String> config) { if (id == null) { throw new NullPointerException("Parameter 'id' must not be null"); } if (systemName == null) { throw new NullPointerException("Parameter 'systemName' must not be null"); } this.id = id; this.systemName = systemName; this.physicalName = physicalName; this.partitionCount = partitionCount; if (config != null) { <START> this.config = Collections.unmodifiableMap(config); <END> } else { this.config = Collections.emptyMap(); } }</code><technical_language>need copy map here. modify map if a reference backing map. this work: this.config = Collections.unmodifiableMap(new HashMap<String, String>(config));</technical_language>

Target:
public StreamSpec(String id, String physicalName, String systemName, int partitionCount, Map<String, String> config) { if (id == null) { throw new NullPointerException("Parameter 'id' must not be null"); } if (systemName == null) { throw new NullPointerException("Parameter 'systemName' must not be null"); } if (partitionCount < 1) { throw new NullPointerException("Parameter 'partitionCount' must not be greater than 0"); } this.id = id; this.systemName = systemName; this.physicalName = physicalName; this.partitionCount = partitionCount; if (config != null) { this.config = Collections.unmodifiableMap(new HashMap<>(config)); } else { this.config = Collections.emptyMap(); } }
Source:
<code>protected boolean authenticate(ContainerRequestContext requestContext, @Nullable C credentials, String scheme) { try { if (credentials == null) { return false; } final Optional<P> principal = authenticator.authenticate(credentials); if (!principal.isPresent()) { return false; } final P prince = principal.get(); final SecurityContext securityContext = requestContext.getSecurityContext(); final boolean secure = securityContext != null && securityContext.isSecure(); requestContext.setSecurityContext(new SecurityContext() { @Override public Principal getUserPrincipal() { return prince; } @Override public boolean isUserInRole(String role) { <START> return authorizer.authorize(prince, role, requestContext.getUriInfo()); <END> } @Override public boolean isSecure() { return secure; } @Override public String getAuthenticationScheme() { return scheme; } }); return true; } catch (AuthenticationException e) { logger.warn("Error authenticating credentials", e); throw new InternalServerErrorException(); } }</code><technical_language>pass complete ContainerRequestContext instead of UriInfo? way, other cases, a request header, supported</technical_language>

Target:
protected boolean authenticate(ContainerRequestContext requestContext, @Nullable C credentials, String scheme) { try { if (credentials == null) { return false; } final Optional<P> principal = authenticator.authenticate(credentials); if (!principal.isPresent()) { return false; } final P prince = principal.get(); final SecurityContext securityContext = requestContext.getSecurityContext(); final boolean secure = securityContext != null && securityContext.isSecure(); requestContext.setSecurityContext(new SecurityContext() { @Override public Principal getUserPrincipal() { return prince; } @Override public boolean isUserInRole(String role) { return authorizer.authorize(prince, role, requestContext); } @Override public boolean isSecure() { return secure; } @Override public String getAuthenticationScheme() { return scheme; } }); return true; } catch (AuthenticationException e) { logger.warn("Error authenticating credentials", e); throw new InternalServerErrorException(); } }
Source:
<code>public String prettyPrint(SkyKey key) { <START> if (SkyFunctions.isSkyFunction(SkyFunctions.CONFIGURED_TARGET).apply(key)) { <END> return ((ConfiguredTargetKey) key.argument()).prettyPrint(); } else if (SkyFunctions.isSkyFunction(SkyFunctions.ASPECT).apply(key)) { return ((AspectKey) key.argument()).prettyPrint(); } else if (key instanceof AspectValueKey) { return ((AspectValueKey) key).getDescription(); } else { return getLabel(key).toString(); } }</code><technical_language>check if instanceof? I clearer here, a good reason to</technical_language>

Target:
public String prettyPrint(SkyKey key) { if (key instanceof ConfiguredTargetKey) { return ((ConfiguredTargetKey) key.argument()).prettyPrint(); } else if (key instanceof AspectKey) { return ((AspectKey) key.argument()).prettyPrint(); } else if (key instanceof AspectValueKey) { return ((AspectValueKey) key).getDescription(); } else { return getLabel(key).toString(); } }