auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void latestFiles() throws Exception { File tempDir = Files.createTempDir(); long currentTime = System.currentTimeMillis(); for (int count = 0; count < 10; count++) { File gcLogFile = new File(tempDir, "gc5625.log" + count); Files.touch(gcLogFile); gcLogFile.setLastModified(currentTime - TimeUnit.DAYS.toMillis(5)); } for (int count = 0; count < 5; count++) { Files.touch(new File(tempDir, "gc3421.log" + count)); } GCLogs.VmArgumentFinder finder = mock(GCLogs.VmArgumentFinder.class); when(finder.findVmArgument(GCLogs.GCLOGS_JRE_SWITCH)).thenReturn(GCLogs.GCLOGS_JRE_SWITCH + new File(tempDir, "gc%p.log").getAbsolutePath()); when(finder.findVmArgument(GCLogs.GCLOGS_ROTATION_SWITCH)).thenReturn(GCLogs.GCLOGS_ROTATION_SWITCH); TestContainer container = new TestContainer(); new GCLogs(finder).addContents(container); <START> assertEquals(5, container.getContents().size()); <END> }</code><technical_language>checking name modified ones</technical_language>

Target:
public void latestFiles() throws Exception { File tempDir = Files.createTempDir(); long currentTime = System.currentTimeMillis(); for (int count = 0; count < 10; count++) { File gcLogFile = new File(tempDir, "gc5625.log" + count); Files.touch(gcLogFile); gcLogFile.setLastModified(currentTime - TimeUnit.DAYS.toMillis(5)); } for (int count = 0; count < 5; count++) { Files.touch(new File(tempDir, "gc3421.log" + count)); } GCLogs.VmArgumentFinder finder = mock(GCLogs.VmArgumentFinder.class); when(finder.findVmArgument(GCLogs.GCLOGS_JRE_SWITCH)).thenReturn(GCLogs.GCLOGS_JRE_SWITCH + new File(tempDir, "gc%p.log").getAbsolutePath()); when(finder.findVmArgument(GCLogs.GCLOGS_ROTATION_SWITCH)).thenReturn(GCLogs.GCLOGS_ROTATION_SWITCH); TestContainer container = new TestContainer(); new GCLogs(finder).addContents(container); assertEquals(5, container.getContents().size()); Assertions.assertThat(container.getContents()) .extracting("file", File.class) .extractingResultOf("getName") .contains("gc3421.log0", "gc3421.log1", "gc3421.log2", "gc3421.log3", "gc3421.log4"); }
Source:
<code>protected boolean buildAnalysisSegments(@NonNull ISegmentStore<@NonNull ISegment> segments, @NonNull IProgressMonitor monitor) throws TmfAnalysisException { final @Nullable ITmfTrace trace = getTrace(); if (trace == null) { analysisReady(false); return false; } <START> waitForSegmentStoreCompletion(); <END> segments.addAll(getSegments()); return true; }</code><technical_language>is passively waiting for external build is finished. possibly wrong!</technical_language>

Target:
protected boolean buildAnalysisSegments(@NonNull ISegmentStore<@NonNull ISegment> segments, @NonNull IProgressMonitor monitor) throws TmfAnalysisException { final @Nullable ITmfTrace trace = getTrace(); if (trace == null) { segmentStoreReady(false); return false; } waitForSegmentStoreCompletion(); segments.addAll(getSegments()); return true; }
Source:
<code>private PinotExpression handleCast(CallExpression cast, Map<VariableReferenceExpression, Selection> context) { if (cast.getArguments().size() == 1) { RowExpression input = cast.getArguments().get(0); Type expectedType = cast.getType(); if (isImplicitCast(input.getType(), expectedType)) { return input.accept(this, context); } else { <START> throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), "Non implicit casts not supported: " + cast); <END> } } throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("This type of CAST operator not supported. Received: %s", cast)); }</code><technical_language>spell out Operator</technical_language>

Target:
private PinotExpression handleCast( CallExpression cast, Map<VariableReferenceExpression, Selection> context) { if (cast.getArguments().size() == 1) { RowExpression input = cast.getArguments().get(0); Type expectedType = cast.getType(); if (isImplicitCast(input.getType(), expectedType)) { return input.accept(this, context); } throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), "Non implicit casts not supported: " + cast); } throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("This type of CAST operator not supported. Received: %s", cast)); }
Source:
<code>void removeDrgElementsWithoutShape( final List<org.kie.dmn.model.api.DRGElement> drgElements, final List<DMNShape> dmnShapes) { if (dmnShapes.size() == 0) { return; } <START> for (int i = drgElements.size() - 1; i >= 0; i--) { <END> final org.kie.dmn.model.api.DRGElement element = drgElements.get(i); final Optional<DMNShape> shape = dmnShapes.stream() .filter(s -> s.getDmnElementRef().getLocalPart().equals(element.getId())) .findFirst(); if (!shape.isPresent()) { drgElements.remove(element); } } }</code><technical_language>reason iterate downwards</technical_language>

Target:
void removeDrgElementsWithoutShape( final List<org.kie.dmn.model.api.DRGElement> drgElements, final List<DMNShape> dmnShapes) { if (dmnShapes.size() == 0) { return; } drgElements.removeIf(element -> !dmnShapes.stream() .filter(s -> Objects.equals(s.getDmnElementRef().getLocalPart(), element.getId())) .findFirst() .isPresent() ); }
Source:
<code>private void setUpMediaWikiBaseUri(final EditTextPreference pref) { pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { private static final String API_PHP_FILENAME = "api.php"; <START> @Override <END> public boolean onPreferenceChange(Preference preference, final Object newValue) { String apiUrl = (String) newValue; if (apiUrl.endsWith(API_PHP_FILENAME)) { apiUrl = apiUrl.replace(API_PHP_FILENAME, ""); } final ProgressDialog dialog = ProgressDialog.show( getActivity(), "", getActivity().getString(R.string.dialog_loading_siteinfo_wait), true ); Retrofit retrofitClient = RetrofitFactory.newInstance(apiUrl, new WikiSite(apiUrl)); Service request = retrofitClient.create(Service.class); Call<MwQueryResponse<SiteInfo>> call = request.requestSiteinfo(); call.enqueue(new retrofit2.Callback<MwQueryResponse<SiteInfo>>() { @Override public void onResponse(Call<MwQueryResponse<SiteInfo>> call, Response<MwQueryResponse<SiteInfo>> response) { if (response.isSuccessful()) { if (response.body().query().server() != null) { pref.setText(response.body().query().server()); } } else { showAlert(getActivity().getString( R.string.dialog_loading_siteinfo_failed, Integer.toString(response.code()) )); } dialog.hide(); } @Override public void onFailure(Call<MwQueryResponse<SiteInfo>> call, Throwable t) { showAlert(getActivity().getString( R.string.dialog_loading_siteinfo_failed, t.getMessage() )); dialog.hide(); } }); return true; } }); }</code><technical_language>try annotations line if</technical_language>

Target:
private void setUpMediaWikiBaseUri(final EditTextPreference pref) { pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, final Object newValue) { SiteInfoClient siteInfoClient = new SiteInfoClient((String) newValue, getActivity()); siteInfoClient.request(new SiteInfoClient.Callback() { public void onSuccess(SiteInfo info) { pref.setText(info.general().server()); } }); return true; } }); }
Source:
<code>protected void createActivatorIfNotExist(Path context) { KieModule kieModule = kieModuleService.resolveModule(context); Package junitActivatorPackage = getOrCreateJunitActivatorPackage(kieModule); final org.uberfire.java.nio.file.Path activatorPath = getActivatorPath(junitActivatorPackage); boolean removeExistingActivator = ensureDependencies(kieModule); if (removeExistingActivator || !ioService.exists(activatorPath)) { <START> removeOldActivatorIfExists(activatorPath, kieModule); <END> ioService.write(activatorPath, ScenarioJunitActivator.ACTIVATOR_CLASS_CODE.apply(junitActivatorPackageName), commentedOptionFactory.makeCommentedOption("")); } }</code><technical_language>I missing something, method if exists removeOldActivatorIfExists if wrap, if exists !ioService.exists(activatorPath), contradiction</technical_language>

Target:
protected void createActivatorIfNotExist(Path context) { KieModule kieModule = kieModuleService.resolveModule(context); Package junitActivatorPackage = getOrCreateJunitActivatorPackage(kieModule); final org.uberfire.java.nio.file.Path activatorPath = getActivatorPath(junitActivatorPackage); boolean needMigrateActivatorIfExists = ensureDependencies(kieModule); if (needMigrateActivatorIfExists || !ioService.exists(activatorPath)) { removeOldActivatorIfExists(activatorPath, kieModule); ioService.write(activatorPath, ScenarioJunitActivator.ACTIVATOR_CLASS_CODE.apply(junitActivatorPackageName), commentedOptionFactory.makeCommentedOption("")); } }
Source:
<code>private PinotExpression handleLogicalBinary( String operator, CallExpression call, Function<VariableReferenceExpression, Selection> context) { if (!LOGICAL_BINARY_OPS_FILTER.contains(operator)) { throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("'%s' is not supported in filter", operator)); } List<RowExpression> arguments = call.getArguments(); if (arguments.size() == 2) { <START> String def0 = arguments.get(0).accept(this, context).getDefinition(); <END> String def1 = arguments.get(1).accept(this, context).getDefinition(); def1 = handleTimeStampAndDateCast(arguments.get(0), def1); def0 = handleTimeStampAndDateCast(arguments.get(1), def0); return derived(format("(%s %s %s)", def0, operator, def1)); } throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("Unknown logical binary: '%s'", call)); }</code><technical_language>I I prefer handleLogicalBinary check for presence of date/time delegate a helper method instead of inlining logic here. is I in code: if (isDateTimeExpression(arguments)) { return handleDateTimeBinaryExpression(operator, call, context) // pass arguments, context .. } // Continue normal handleLogicalBinary flow</technical_language>

Target:
private PinotExpression handleLogicalBinary( String operator, CallExpression call, Function<VariableReferenceExpression, Selection> context) { if (!LOGICAL_BINARY_OPS_FILTER.contains(operator)) { throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("'%s' is not supported in filter", operator)); } List<RowExpression> arguments = call.getArguments(); if (arguments.size() == 2) { return handleDateOrTimestampBinaryExpression(operator, arguments, context).orElseGet( () -> derived(format( "(%s %s %s)", arguments.get(0).accept(this, context).getDefinition(), operator, arguments.get(1).accept(this, context).getDefinition()))); } throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("Unknown logical binary: '%s'", call)); }
Source:
<code>public int execute() throws HiveException { DataOutputStream outStream = getOutputStream(ddlDesc.getResFile()); try { Database database = db.getDatabase(ddlDesc.getDatabaseName()); if (database == null) { throw new HiveException(ErrorMsg.DATABASE_NOT_EXISTS, ddlDesc.getDatabaseName()); } Map<String, String> params = null; if (ddlDesc.isExt()) { params = database.getParameters(); } if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_IN_TEST) && params != null) { params = new TreeMap<String, String>(params); } String location = database.getLocationUri(); if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_IN_TEST)) { location = "location/in/test"; } <START> <END> PrincipalType ownerType = database.getOwnerType(); formatter.showDatabaseDescription(outStream, database.getName(), database.getDescription(), location, database.getOwnerName(), (null == ownerType) ? null : ownerType.name(), params); } catch (Exception e) { throw new HiveException(e, ErrorMsg.GENERIC_ERROR); } finally { IOUtils.closeStream(outStream); } return 0; }</code><technical_language>do this alwregardless in test; this means is order in desc command outputs props is undefined running tests..</technical_language>

Target:
public int execute() throws HiveException { try (DataOutputStream outStream = getOutputStream(new Path(desc.getResFile()))) { Database database = context.getDb().getDatabase(desc.getDatabaseName()); if (database == null) { throw new HiveException(ErrorMsg.DATABASE_NOT_EXISTS, desc.getDatabaseName()); } Map<String, String> params = null; if (desc.isExt()) { params = database.getParameters(); } if (HiveConf.getBoolVar(context.getConf(), HiveConf.ConfVars.HIVE_IN_TEST) && params != null) { params = new TreeMap<String, String>(params); } String location = database.getLocationUri(); if (HiveConf.getBoolVar(context.getConf(), HiveConf.ConfVars.HIVE_IN_TEST)) { location = "location/in/test"; } PrincipalType ownerType = database.getOwnerType(); context.getFormatter().showDatabaseDescription(outStream, database.getName(), database.getDescription(), location, database.getOwnerName(), (null == ownerType) ? null : ownerType.name(), params); } catch (Exception e) { throw new HiveException(e, ErrorMsg.GENERIC_ERROR); } return 0; }
Source:
<code>public MockVaadinServletService( DeploymentConfiguration deploymentConfiguration) { super(new MockVaadinServlet(deploymentConfiguration), <START> deploymentConfiguration); <END> }</code><technical_language>init automatically anymore</technical_language>

Target:
public MockVaadinServletService( DeploymentConfiguration deploymentConfiguration) { super(new MockVaadinServlet(deploymentConfiguration), deploymentConfiguration); init(); }
Source:
<code>public BiomeGenerationSettings getBiomeSettings(BiomeType type) { <START> checkNotNull(type); <END> BiomeGenerationSettings settings = this.biomeSettings.get(type); if (settings == null) { if (type instanceof VirtualBiomeType) { settings = ((VirtualBiomeType) type).getDefaultGenerationSettings().copy(); this.biomeSettings.put(type, settings); } else { settings = ((IMixinBiome) type).initPopulators(this.world); this.biomeSettings.put(type, settings); } } return settings; }</code><technical_language>checkNotNull(type, "type");</technical_language>

Target:
public BiomeGenerationSettings getBiomeSettings(BiomeType type) { checkNotNull(type, "type"); BiomeGenerationSettings settings = this.biomeSettings.get(type); if (settings == null) { settings = type.createDefaultGenerationSettings((org.spongepowered.api.world.World) this.world); this.biomeSettings.put(type, settings); } return settings; }
Source:
<code>public void testGetTrackingKey() throws Exception { String trackedEventPrefixKey = "AMPLIFY_"; String iEventKey = "MOCK_EVENT"; String iEventCheckKey = "MOCK_EVENT_CHECK"; IEvent iEvent = Mockito.mock(IEvent.class); <START> Mockito.when(iEvent.getTrackingKey()).thenReturn(iEventKey); <END> IEventCheck iEventCheck = Mockito.mock(IEventCheck.class); Mockito.when(iEventCheck.getTrackingKey()).thenReturn(iEventCheckKey); TrackedEvent trackedEvent = new TrackedEvent(iEvent, iEventCheck); Assert.assertEquals(trackedEventPrefixKey + iEventKey + "_" + iEventCheckKey, trackedEvent.getTrackingKey()); }</code><technical_language>static import pls</technical_language>

Target:
public void testGetTrackingKey() throws Exception { String trackedEventPrefixKey = "AMPLIFY_"; String iEventKey = "MOCK_EVENT"; String iEventCheckKey = "MOCK_EVENT_CHECK"; IEvent iEvent = mock(IEvent.class); when(iEvent.getTrackingKey()).thenReturn(iEventKey); IEventCheck iEventCheck = mock(IEventCheck.class); when(iEventCheck.getTrackingKey()).thenReturn(iEventCheckKey); TrackedEvent trackedEvent = new TrackedEvent(iEvent, iEventCheck); assertEquals("The tracking key for a TrackedEvent is incorrect", trackedEventPrefixKey + iEventKey + "_" + iEventCheckKey, trackedEvent.getTrackingKey()); }
Source:
<code>public void forEach(Consumer<? super Entry<K, V>> action) { if (associatedMap.elementCount > 0) { int prevModCount = associatedMap.modCount; for (int i = 0; i < associatedMap.elementData.length; i++) { HashEntry<K, V> entry = associatedMap.elementData[i]; while (entry != null) { action.accept(entry); entry = entry.next; } } <START> if (prevModCount != associatedMap.modCount) { <END> throw new TConcurrentModificationException(); } } }</code><technical_language>I this check done accept call. least, this behaviour consistent default forEach implementation Iterable class</technical_language>

Target:
public void forEach(Consumer<? super Entry<K, V>> action) { if (associatedMap.elementCount > 0) { int prevModCount = associatedMap.modCount; for (int i = 0; i < associatedMap.elementData.length; i++) { HashEntry<K, V> entry = associatedMap.elementData[i]; while (entry != null) { action.accept(entry); entry = entry.next; if (prevModCount != associatedMap.modCount) { throw new TConcurrentModificationException(); } } } } }
Source:
<code>public void handlePost(RestRequestInfo restRequestInfo) throws RestServiceException { if (restRequestInfo.isFirstPart()) { adminMetrics.postOperationRate.mark(); } <START> logger.debug("While trying to perform POST: Unsupported operation - POST"); <END> adminMetrics.unsupportedPostOperation.inc(); throw new RestServiceException("Unsupported operation for Admin service - POST", RestServiceErrorCode.UnsupportedOperation); }</code><technical_language>"Unsupported operation POST"</technical_language>

Target:
public void handlePost(RestRequestInfo restRequestInfo) throws RestServiceException { if (restRequestInfo.isFirstPart()) { adminMetrics.postOperationRate.mark(); } adminMetrics.unsupportedPostOperationError.inc(); throw new RestServiceException("Unsupported operation for Admin service - POST", RestServiceErrorCode.UnsupportedOperation); }
Source:
<code>public synchronized void saveDiskQuotaConfig(DiskQuotaConfig config, JDBCConfiguration jdbcConfig) throws ConfigurationException, IOException, InterruptedException { Resource configFile = configDir.get("geowebcache-diskquota-jdbc.xml"); if ("JDBC".equals(config.getQuotaStore())) { JDBCConfiguration encrypted = passwordHelper.encryptPassword(jdbcConfig); OutputStream os = configFile.out(); try { JDBCConfiguration.store(encrypted, os); } finally { <START> os.close(); <END> } } else { if (Resources.exists(configFile) && !configFile.delete()) { LOGGER.log(Level.SEVERE, "Failed to delete " + configFile + ", this might cause misbehavior on GeoServer restart"); } } }</code><technical_language>This shorter try-with-resources</technical_language>

Target:
public synchronized void saveDiskQuotaConfig(DiskQuotaConfig config, JDBCConfiguration jdbcConfig) throws ConfigurationException, IOException, InterruptedException { Resource configFile = configDir.get("geowebcache-diskquota-jdbc.xml"); if ("JDBC".equals(config.getQuotaStore())) { JDBCConfiguration encrypted = passwordHelper.encryptPassword(jdbcConfig); try (OutputStream os = configFile.out()) { JDBCConfiguration.store(encrypted, os); } } else { if (Resources.exists(configFile) && !configFile.delete()) { LOGGER.log(Level.SEVERE, "Failed to delete " + configFile + ", this might cause misbehavior on GeoServer restart"); } } }
Source:
<code>public void testGetLocalPathForWriteForLessSpace() throws Exception { String dir0 = buildBufferDir(ROOT, 0); String dir1 = buildBufferDir(ROOT, 1); conf.set(CONTEXT, dir0 + "," + dir1); <START> LambdaTestUtils.intercept(DiskErrorException.class, "as the max capacity" + <END> " in any directory is", "Expect a DiskErrorException.", () -> dirAllocator.getLocalPathForWrite("p1/x", Long.MAX_VALUE-1, conf)); }</code><technical_language>minor nit, move "as max" capacity string a line own' merge a single string,</technical_language>

Target:
public void testGetLocalPathForWriteForLessSpace() throws Exception { String dir0 = buildBufferDir(ROOT, 0); String dir1 = buildBufferDir(ROOT, 1); conf.set(CONTEXT, dir0 + "," + dir1); LambdaTestUtils.intercept(DiskErrorException.class, "as the max capacity in any directory is", "Expect a DiskErrorException.", () -> dirAllocator.getLocalPathForWrite("p1/x", Long.MAX_VALUE-1, conf)); }
Source:
<code>public Result<SearchResultValue> apply(Result<SearchResultValue> arg1, Result<SearchResultValue> arg2) { if (arg1 == null) { return arg2; } if (arg2 == null) { return arg1; } <START> final int limit = gran instanceof AllGranularity ? this.limit : -1; <END> SearchResultValue arg1Vals = arg1.getValue(); SearchResultValue arg2Vals = arg2.getValue(); Iterable<SearchHit> merged = Iterables.mergeSorted( Arrays.asList(arg1Vals, arg2Vals), searchSortSpec.getComparator() ); List<SearchHit> results = Lists.newArrayList(); SearchHit prev = null; for (SearchHit searchHit : merged) { if (prev == null) { prev = searchHit; continue; } if (prev.equals(searchHit)) { if (prev.getCount() != null) { prev = new SearchHit( prev.getDimension(), prev.getValue(), prev.getCount() + searchHit.getCount() ); } } else { results.add(prev); prev = searchHit; if (limit > 0 && results.size() >= limit) { break; } } } if (prev != null && (limit < 0 || results.size() < limit)) { results.add(prev); } final DateTime timestamp = gran instanceof AllGranularity ? arg1.getTimestamp() : gran.toDateTime(gran.truncate(arg1.getTimestamp().getMillis())); return new Result<SearchResultValue>(timestamp, new SearchResultValue(results)); }</code><technical_language>limit in case of granularity</technical_language>

Target:
public Result<SearchResultValue> apply(Result<SearchResultValue> arg1, Result<SearchResultValue> arg2) { if (arg1 == null) { return arg2; } if (arg2 == null) { return arg1; } final int limit = gran instanceof AllGranularity ? this.limit : -1; SearchResultValue arg1Vals = arg1.getValue(); SearchResultValue arg2Vals = arg2.getValue(); Iterable<SearchHit> merged = Iterables.mergeSorted( Arrays.asList(arg1Vals, arg2Vals), searchSortSpec.getComparator() ); int maxSize = arg1Vals.getValue().size() + arg2Vals.getValue().size(); if (limit > 0) { maxSize = Math.min(limit, maxSize); } List<SearchHit> results = Lists.newArrayListWithExpectedSize(maxSize); SearchHit prev = null; for (SearchHit searchHit : merged) { if (prev == null) { prev = searchHit; continue; } if (prev.equals(searchHit)) { if (prev.getCount() != null) { prev = new SearchHit( prev.getDimension(), prev.getValue(), prev.getCount() + searchHit.getCount() ); } } else { results.add(prev); prev = searchHit; if (limit > 0 && results.size() >= limit) { break; } } } if (prev != null && (limit < 0 || results.size() < limit)) { results.add(prev); } final DateTime timestamp = gran instanceof AllGranularity ? arg1.getTimestamp() : gran.toDateTime(gran.truncate(arg1.getTimestamp().getMillis())); return new Result<SearchResultValue>(timestamp, new SearchResultValue(results)); }
Source:
<code>public Map<TopicPartition, OffsetAndMetadata> preCommit( Map<TopicPartition, OffsetAndMetadata> currentOffsets ) { <START> Map<TopicPartition, OffsetAndMetadata> result = new HashMap<>(); <END> hdfsWriter.getCommittedOffsets() .forEach((tp, offset) -> result.put(tp, new OffsetAndMetadata(offset))); log.debug("Returning committed offsets {}", result); return result; }</code><technical_language>suggest java streams :) For example: suggestion Map<TopicPartition, OffsetAndMetadata> result = hdfsWriter.getCommittedOffsets() .entrySet() .stream() .collect(Collectors.toMap(e -> e.getKey(), e -> new OffsetAndMetadata(e.getValue()));</technical_language>

Target:
public Map<TopicPartition, OffsetAndMetadata> preCommit( Map<TopicPartition, OffsetAndMetadata> currentOffsets ) { Map<TopicPartition, OffsetAndMetadata> result = new HashMap<>(); for (Map.Entry<TopicPartition, Long> entry : hdfsWriter.getCommittedOffsets().entrySet()) { log.debug( "Found last committed offset for topic partition {}", entry.getValue(), entry.getKey() ); result.put(entry.getKey(), new OffsetAndMetadata(entry.getValue())); } log.debug("Returning committed offsets {}", result); return result; }
Source:
<code>public void verifyToken(String token, String targetSubject, Map<String, String> claimMap) { JwtConsumer jwtConsumer = new JwtConsumerBuilder() .setRequireSubject() .setVerificationKey(key) .setRelaxVerificationKeyValidation() .build(); <START> <END> JwtClaims jwtClaims; String subject; try { jwtClaims = jwtConsumer.processToClaims(token); subject = jwtClaims.getSubject(); } catch (InvalidJwtException | MalformedClaimException e) { throw new SecurityTokenException(String.format("Invalid JWT: value-[%s]", token), e); } if (!targetSubject.equals(subject)) { throw new SecurityTokenException(String.format("Invalid JWT: value-[%s]", token)); } boolean claimMatch = claimMap.entrySet().stream().allMatch((e) -> { return e.getValue().equals(jwtClaims.getClaimValue(e.getKey())); }); if (!claimMatch) { throw new SecurityTokenException(String.format("Invalid JWT: value-[%s]", token)); } }</code><technical_language>Cosmetic/trivial: code style is: JwtConsumer jwtConsumer = new JwtConsumerBuilder().setRequireSubject() .setVerificationKey(key) .setRelaxVerificationKeyValidation() .build(); (the chained method is line chained methods, align dot)</technical_language>

Target:
public void verifyToken(String token, String targetSubject, Map<String, String> claimMap) { JwtConsumer jwtConsumer = new JwtConsumerBuilder().setRequireSubject() .setVerificationKey(key) .setRelaxVerificationKeyValidation() .build(); JwtClaims jwtClaims; String subject; try { jwtClaims = jwtConsumer.processToClaims(token); subject = jwtClaims.getSubject(); } catch (InvalidJwtException | MalformedClaimException e) { throw new SecurityTokenException(String.format(MESSAGE_INVALID_JWT, token), e); } if (!targetSubject.equals(subject)) { throw new SecurityTokenException(String.format(MESSAGE_INVALID_JWT, token)); } boolean claimMatch = claimMap.entrySet().stream().allMatch((e) -> { return e.getValue().equals(jwtClaims.getClaimValue(e.getKey())); }); if (!claimMatch) { throw new SecurityTokenException(String.format(MESSAGE_INVALID_JWT, token)); } }
Source:
<code>public ModelMergeToolAction() { <START> super(EMFCompareEGitUIMessages.getString("ModelMergeToolCommandID"), END> new ModelMergeToolActionHandler()); }</code><technical_language>No. a constant, create if needed, externalize constants, externalize strings need internationalized</technical_language>

Target:
public ModelMergeToolAction() { super(MERGE_TOOL_BUTTON_ID, new ModelMergeToolActionHandler()); }
Source:
<code><START> boolean isPowerManagementLegal() { <END> return IsPowerManagementLegal(getParameters().getVdsStaticData(), getVdsGroup() .getcompatibility_version().toString()); }</code><technical_language>please set a modifier - protected suitable</technical_language>

Target:
protected boolean isPowerManagementLegal() { return IsPowerManagementLegal(getParameters().getVdsStaticData(), getVdsGroup() .getcompatibility_version().toString()); }
Source:
<code>public void tearDown() throws Exception { <START> GrillServices.get().setServiceMode(GrillServices.SERVICE_MODE.OPEN); <END> super.tearDown(); }</code><technical_language>is server mode set OPEN in teardown</technical_language>

Target:
public void tearDown() throws Exception { super.tearDown(); }
Source:
<code><START> @Test public void givenMultipleRequestsWhenResponseThenLog() throws InterruptedException { <END> AtomicInteger completedReqs = new AtomicInteger(0); OptionalInt optHttpsPort = testServer.getRunningHttpsPort(); String url; int port; if (optHttpsPort.isPresent()) { port = optHttpsPort.getAsInt(); url = "https://localhost:" + port; } else { port = testServer.getRunningHttpPort().getAsInt(); url = "http://localhost:" + port; } WSClient ws = play.test.WSTestClient.newClient(port); IntStream.range(0, 100).parallel().forEach(num -> ws.url(url) .setRequestFilter(new AhcCurlRequestLogger()) .addHeader("key", "value") .addQueryParameter("num", "" + num) .get() .thenAccept(r -> { log.debug("Thread#" + num + " Request complete: Response code = " + r.getStatus() + " | Response: " + r.getBody() + " | Current Time:" + System.currentTimeMillis()); completedReqs.incrementAndGet(); }) ); log.debug("Waiting for requests to be completed. Current Time: " + System.currentTimeMillis()); while (completedReqs.get() != 100) { Thread.sleep(100); } log.debug("All requests have been completed. Exiting test."); }</code><technical_language>@Test annotation appears line test function</technical_language>

Target:
public void givenMultipleRequestsWhenResponseThenLog() throws Exception { CountDownLatch latch = new CountDownLatch(100); WSClient ws = play.test.WSTestClient.newClient(port); IntStream.range(0, 100) .parallel() .forEach(num -> ws.url(url) .setRequestFilter(new AhcCurlRequestLogger()) .addHeader("key", "value") .addQueryParameter("num", "" + num) .get() .thenAccept(r -> { log.debug( "Thread#" + num + " Request complete: Response code = " + r.getStatus() + " | Response: " + r.getBody() + " | Current Time:" + System.currentTimeMillis()); latch.countDown(); }) ); log.debug( "Waiting for requests to be completed. Current Time: " + System.currentTimeMillis()); latch.await(5, TimeUnit.SECONDS ); assertEquals(0, latch.getCount()); log.debug("All requests have been completed. Exiting test."); }
Source:
<code>public void handle(Request request, Response response) throws Exception { try (DbSession dbSession = dbClient.openSession(false)) { String componentKey = request.mandatoryParam(PARAM_KEY); ComponentDto component = componentFinder.getByKey(dbSession, componentKey); userSession.checkComponentPermission(USER, component); Map<String, String> keysByUUid = keysByUUid(dbSession, component); ScannerInput.ServerIssue.Builder responseBuilder = ScannerInput.ServerIssue.newBuilder(); response.stream().setMediaType(MediaTypes.PROTOBUF); OutputStream output = response.stream().output(); ResultHandler<IssueDto> handler = resultContext -> { IssueDto issue = resultContext.getResultObject(); handleIssue(issue, responseBuilder, keysByUUid, output); }; switch (component.scope()) { case Scopes.PROJECT: dbClient.issueDao().scrollNonClosedByModuleOrProject(dbSession, component, handler); break; case Scopes.FILE: dbClient.issueDao().scrollNonClosedByComponentUuid(dbSession, component.uuid(), handler); break; default: <START> throw new IllegalStateException(format("Component of scope '%s' is not allowed", component.scope())); <END> } } }</code><technical_language>I propose replace this ISA a IAE, a functional error</technical_language>

Target:
public void handle(Request request, Response response) throws Exception { try (DbSession dbSession = dbClient.openSession(false)) { String componentKey = request.mandatoryParam(PARAM_KEY); ComponentDto component = componentFinder.getByKey(dbSession, componentKey); userSession.checkComponentPermission(USER, component); Map<String, String> keysByUUid = keysByUUid(dbSession, component); ScannerInput.ServerIssue.Builder responseBuilder = ScannerInput.ServerIssue.newBuilder(); response.stream().setMediaType(MediaTypes.PROTOBUF); OutputStream output = response.stream().output(); ResultHandler<IssueDto> handler = resultContext -> { IssueDto issue = resultContext.getResultObject(); handleIssue(issue, responseBuilder, keysByUUid, output); }; switch (component.scope()) { case Scopes.PROJECT: dbClient.issueDao().scrollNonClosedByModuleOrProject(dbSession, component, handler); break; case Scopes.FILE: dbClient.issueDao().scrollNonClosedByComponentUuid(dbSession, component.uuid(), handler); break; default: throw new IllegalArgumentException(format("Component of scope '%s' is not allowed", component.scope())); } } }
Source:
<code>private byte[] getHeaderValue(Object value) { if (value instanceof String) { return ((String) value).getBytes(); } else if (value instanceof Long) { ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); buffer.putLong((Long) value); return buffer.array(); } else if (value instanceof Integer) { ByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES); buffer.putInt((Integer) value); return buffer.array(); } else if (value instanceof byte[]) { return (byte[]) value; } return null; <START> } <END></code><technical_language>Is reason String, Long, integer byte[]? I send Double Byte Boolean[]</technical_language>

Target:
private byte[] getHeaderValue(Object value) { if (value instanceof String) { return ((String) value).getBytes(); } else if (value instanceof Long) { ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); buffer.putLong((Long) value); return buffer.array(); } else if (value instanceof Integer) { ByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES); buffer.putInt((Integer) value); return buffer.array(); } else if (value instanceof Double) { ByteBuffer buffer = ByteBuffer.allocate(Double.BYTES); buffer.putDouble((Double) value); return buffer.array(); } else if (value instanceof byte[]) { return (byte[]) value; } log.debug("Cannot propagate header value of type[{}], skipping... " + "Supported types: String, Integer, Long, Double, byte[].", value != null ? value.getClass() : "null"); return null; }
Source:
<code>public void set(double x) { for (;;) { Cell[] as; if ((as = cells) != null) { if (busy == 0 && casBusy()) { try { if (cells == as) { int n = as.length; Cell[] rs = new Cell[n]; for (int i = 0; i < n; ++i) { Cell a = as[i]; if (a != null) <START> rs[i] = new Cell(0L); <END> } cells = rs; base = Double.doubleToLongBits(x); break; } } finally { busy = 0; } } } else { base = Double.doubleToLongBits(x); break; } } }</code><technical_language>This a lot of allocations</technical_language>

Target:
public void set(double x) { for (;;) { Cell[] as; if ((as = cells) != null) { if (busy == 0 && casBusy()) { try { if (cells == as) { cells = null; base = Double.doubleToLongBits(x); break; } } finally { busy = 0; } } } else { base = Double.doubleToLongBits(x); break; } } }
Source:
<code>private Collection<Cell> getSubCellsByLabel(Cell<?> cell, String label) { <START> Object content = cell.getContent(); <END> if (content instanceof CellCollection) { return ((CellCollection) content).cellMap().get(label); } else if (content instanceof Cell) { return Collections.singleton((Cell) content); } else { assert false; return null; } }</code><technical_language>right fine toString I kind of get. this</technical_language>

Target:
private Collection<Cell> getSubCellsByLabel(Cell<?> cell, String label) { Object content = cell.getContent(); if (content instanceof CellCollection) { return ((CellCollection) content).cellMap().get(label); } else if (content instanceof Cell) { return cell.getLabel().equals(label) ? Collections.singletonList((Cell) content) : Collections.<Cell>emptyList(); } else { assert false : "Wrong instruction!"; return null; } }
Source:
<code>protected boolean validate() { if (getVds().isPmEnabled()) { List<FenceAgent> fenceAgents = fenceAgentDao.getFenceAgentsForHost(getVdsId()); if (fenceAgents.size() == 1) { return failValidation(EngineMessage.VDS_REMOVE_LAST_FENCE_AGENT_PM_ENABLED); } } <START> if (getParameters() == null || getParameters().getAgent() == null || getParameters().getAgent().getId() == null) { <END> return failValidation(EngineMessage.VDS_REMOVE_FENCE_AGENT_ID_REQUIRED); } return super.validate(); }</code><technical_language>This is null check condition, sense validate this 1st step do database check number of fence agents</technical_language>

Target:
protected boolean validate() { if (getParameters() == null || getParameters().getAgent() == null || getParameters().getAgent().getId() == null) { return failValidation(EngineMessage.VDS_REMOVE_FENCE_AGENT_ID_REQUIRED); } if (getVds().isPmEnabled()) { List<FenceAgent> fenceAgents = fenceAgentDao.getFenceAgentsForHost(getVdsId()); if (fenceAgents.size() == 1) { return failValidation(EngineMessage.VDS_REMOVE_LAST_FENCE_AGENT_PM_ENABLED); } } return super.validate(); }
Source:
<code>public List<Alert> getExampleAlerts() { List<Alert> alerts = new ArrayList<Alert>(); Alert alert = <START> newAlert() <END> .setRisk(Alert.RISK_LOW) .setConfidence(Alert.CONFIDENCE_MEDIUM) .setDescription(getDescription()) .setSolution(getSolution()) .setReference(getReference()) .setCweId(getCweId()) .setWascId(getWascId()) .build(); alerts.add(alert); return alerts; }</code><technical_language>This call existing method, avoids maintaining info in places (which is error prone). another PR similar changes: <LINK_0> methods getCweId() getWascId() longer needed</technical_language>

Target:
public List<Alert> getExampleAlerts() { List<Alert> alerts = new ArrayList<Alert>(); alerts.add(buildAlert(new HttpMessage(), "").build()); return alerts; }
Source:
<code><START> @Override public void setPickupStatus(PickupStatus pickupStatus) { <END> customPickupStatus = pickupStatus; }</code><technical_language>Annotations line</technical_language>

Target:
public void setPickupStatus(PickupStatus pickupStatus) { customPickupStatus = pickupStatus; }
Source:
<code>public void membershipChanged(List<Node> previousMembers, List<Node> members, final boolean merged) { if (this.getGroup().isCoordinator()) { Set<Node> deadNodes = new HashSet<>(previousMembers); deadNodes.removeAll(members); Set<Node> newNodes = new HashSet<>(members); newNodes.removeAll(previousMembers); if (!deadNodes.isEmpty()) { try (Batch batch = this.batcher.createBatch()) { try (CloseableIterator<Map.Entry<T, Set<Node>>> entries = this.cache.entrySet().iterator()) { while (entries.hasNext()) { Map.Entry<T, Set<Node>> entry = entries.next(); Set<Node> nodes = entry.getValue(); if (nodes.removeAll(deadNodes)) { entry.setValue(nodes); } } } } } <START> if (merged) { <END> try (Batch batch = this.batcher.createBatch()) { for (Node node: newNodes) { this.getServices(node).forEach(service -> this.register(node, service)); } } } } }</code><technical_language>If previous try block throws exception, this next step happen (i.e. in a finally block)(</technical_language>

Target:
public void membershipChanged(List<Node> previousMembers, List<Node> members, final boolean merged) { if (this.getGroup().isCoordinator()) { Set<Node> deadNodes = new HashSet<>(previousMembers); deadNodes.removeAll(members); Set<Node> newNodes = new HashSet<>(members); newNodes.removeAll(previousMembers); if (!deadNodes.isEmpty()) { try (Batch batch = this.batcher.createBatch()) { try (CloseableIterator<Map.Entry<T, Set<Node>>> entries = this.cache.entrySet().iterator()) { while (entries.hasNext()) { Map.Entry<T, Set<Node>> entry = entries.next(); Set<Node> nodes = entry.getValue(); if (nodes.removeAll(deadNodes)) { entry.setValue(nodes); } } } } } if (merged) { for (Node node: newNodes) { try { Collection<T> services = this.dispatcher.executeOnNode(new GetLocalServicesCommand<>(), node).get(); try (Batch batch = this.batcher.createBatch()) { services.forEach(service -> this.register(node, service)); } } catch (Exception e) { ClusteringServerLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e); } } } } }
Source:
<code>private void process() { final IncomingMessageEnvelope envelope = state.fetchEnvelope(); log.trace("Process ssp offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); Runnable processWorker = () -> { final ReadableCoordinator coordinator = new ReadableCoordinator(task.taskName()); TaskCallbackFactory callbackFactory = new TaskCallbackFactory() { @Override public TaskCallback createCallback() { state.startProcess(); containerMetrics.processes().inc(); return callbackManager.createCallback(task.taskName(), envelope, coordinator); } }; task.process(envelope, coordinator, callbackFactory); }; <START> if (threadPool != null) { <END> threadPool.submit(processWorker); } else { processWorker.run(); } }</code><technical_language>This is a bad pattern in code. fix atleast this instance of it. This threadPool is passed SamzaContainer a null. val taskThreadPool = if (threadPoolSize > 0) { Executors.newFixedThreadPool(threadPoolSize, new ThreadFactoryBuilder().setNameFormat("Samza Container Thread-%d").build()) } else { null } a. push thread-pool creation place used. b. Alternatively, create a single-threaded executor pool. c. pass optional</technical_language>

Target:
private void process() { final IncomingMessageEnvelope envelope = state.fetchEnvelope(); log.trace("Process ssp offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); final ReadableCoordinator coordinator = new ReadableCoordinator(task.taskName()); TaskCallbackFactory callbackFactory = new TaskCallbackFactory() { @Override public TaskCallback createCallback() { state.startProcess(); containerMetrics.processes().inc(); return callbackManager.createCallback(task.taskName(), envelope, coordinator); } }; task.process(envelope, coordinator, callbackFactory); }
Source:
<code>private SkipRevFilter(int skip) { <START> this.count = 0; <END> this.skip = skip; }</code><technical_language>Count need explicitly initialized is 0 default</technical_language>

Target:
private SkipRevFilter(int skip) { this.skip = skip; }
Source:
<code>private String buildUrl(final CreateCategoryContext context) { <START> return DiscussionsOperations.service(String.format(GET_CATEGORIES_URL_SUFFIX, context.getSiteId())); <END> }</code><technical_language>DiscussionsApi DiscussionsService DiscussionsGateway DiscussionsClient</technical_language>

Target:
private String buildUrl(final CreateCategoryContext context) { return DiscussionsClient.service(String.format(GET_CATEGORIES_URL_SUFFIX, context.getSiteId())); }
Source:
<code>private static <T> QueryWeigher<T> writeWeigher(long numRows, Supplier<Long> bytesWritten) { Supplier<Long> weight = Suppliers.memoize(() -> safeGetNumBytesOrDefault(bytesWritten)); return new QueryWeigher<T>() { @Override public QueryWeight weighSuccess(T result, long timeTakenNanos) { return ImmutableQueryWeight.builder() <START> .from(DEFAULT_ESTIMATED_WEIGHT) <END> .numBytes(weight.get()) .numDistinctRows(numRows) .timeTakenNanos(timeTakenNanos) .build(); } @Override public QueryWeight weighFailure(Exception error, long timeTakenNanos) { return weighSuccess(null, timeTakenNanos); } }; }</code><technical_language>remove DEFAULT_ESTIMATED_WEIGHT entirely, setting attributes overriding default parameters anyway. This is remaining of variable</technical_language>

Target:
private static <T> QueryWeigher<T> writeWeigher(long numRows, Supplier<Long> bytesWritten) { Supplier<Long> weight = Suppliers.memoize(() -> safeGetNumBytesOrDefault(bytesWritten)); return new QueryWeigher<T>() { @Override public QueryWeight weighSuccess(T result, long timeTakenNanos) { return ImmutableQueryWeight.builder() .numBytes(weight.get()) .numDistinctRows(numRows) .timeTakenNanos(timeTakenNanos) .build(); } @Override public QueryWeight weighFailure(Exception error, long timeTakenNanos) { return weighSuccess(null, timeTakenNanos); } }; }
Source:
<code>private synchronized void updateProperties() { if (connectorFile.lastModified() == cacheTimestamp) { return; } Properties props = new Properties(); try { FileReader reader = new FileReader(connectorFile); props.load(reader); <START> reader.close(); <END> } catch (IOException e) { throw new IllegalStateException(e); } this.propertiesMap = Maps.fromProperties(props); cacheTimestamp = connectorFile.lastModified(); }</code><technical_language>move reader.close() finally</technical_language>

Target:
private synchronized void updateProperties() { if (connectorFile.lastModified() == cacheTimestamp) { return; } Properties props = new Properties(); FileReader reader; try { reader = new FileReader(connectorFile); } catch (FileNotFoundException e) { throw new IllegalStateException(e); } try { props.load(reader); } catch (IOException e) { throw new IllegalStateException(e); } finally { IOUtils.closeQuietly(reader); } this.propertiesMap = Maps.fromProperties(props); cacheTimestamp = connectorFile.lastModified(); }
Source:
<code>public static Node createInvalidType(Node node, NodeType type) { StringBuilder message = new StringBuilder("Invalid type " + node.getType() + ", expected " + type); if (node.getParent() != null && node.getParent() instanceof KeyValueNode) { <START> message.append(" (key: \"" + ((KeyValueNode) node.getParent()).getKey() + "\")"); <END> } return new ErrorNode(message.toString()); }</code><technical_language>adding this this error message only</technical_language>

Target:
public static Node createInvalidType(Node node, NodeType type) { return new ErrorNode("Invalid type " + node.getType() + ", expected " + type); }
Source:
<code><START> public void doGenerateBundle(@QueryParameter("components") String components, StaplerResponse rsp) throws IOException { <END> if (components == null) { rsp.sendError(HttpServletResponse.SC_BAD_REQUEST, "components parameter is mandatory"); return; } List<String> componentNames = Arrays.asList(components.split(",")); logger.fine("Selecting components..."); prepareBundle(rsp, getComponents().stream().filter(c -> componentNames.contains(c.getId())).collect(Collectors.toList())); }</code><technical_language>missing some permission check here</technical_language>

Target:
public void doGenerateBundle(@QueryParameter("components") String components, StaplerResponse rsp) throws IOException { if (components == null) { rsp.sendError(HttpServletResponse.SC_BAD_REQUEST, "components parameter is mandatory"); return; } List<String> componentNames = Arrays.asList(components.split(",")); logger.fine("Selecting components..."); List<Component> selectedComponents = getComponents().stream().filter(c -> componentNames.contains(c.getId())).collect(Collectors.toList()); if (selectedComponents.isEmpty()) { rsp.sendError(HttpServletResponse.SC_BAD_REQUEST, "selected component list is empty"); return; } prepareBundle(rsp, selectedComponents); }
Source:
<code>private ChannelPool newPool(SocketAddress address) { log.debugf("Creating new channel pool for %s", address); Bootstrap bootstrap = new Bootstrap() .group(eventLoopGroup) <START> .channel(NioSocketChannel.class) <END> .remoteAddress(address) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.connectionTimeout()) .option(ChannelOption.SO_KEEPALIVE, configuration.tcpKeepAlive()) .option(ChannelOption.TCP_NODELAY, configuration.tcpNoDelay()) .option(ChannelOption.SO_RCVBUF, 1024576); int maxConnections = configuration.connectionPool().maxActive(); if (maxConnections < 0) { maxConnections = Integer.MAX_VALUE; } ChannelInitializer channelInitializer = new ChannelInitializer(bootstrap, address, operationsFactory, configuration); bootstrap.handler(channelInitializer); ChannelPool pool = new ChannelPool(bootstrap.config().group().next(), address, channelInitializer, configuration.connectionPool().exhaustedAction(), configuration.connectionPool().maxWait(), maxConnections); channelInitializer.setChannelPool(pool); return pool; }</code><technical_language>Epoll (if is supported). this is done in Hot Rod Server</technical_language>

Target:
private ChannelPool newPool(SocketAddress address) { log.debugf("Creating new channel pool for %s", address); Bootstrap bootstrap = new Bootstrap() .group(eventLoopGroup) .channel(TransportHelper.socketChannel()) .remoteAddress(address) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.connectionTimeout()) .option(ChannelOption.SO_KEEPALIVE, configuration.tcpKeepAlive()) .option(ChannelOption.TCP_NODELAY, configuration.tcpNoDelay()) .option(ChannelOption.SO_RCVBUF, 1024576); int maxConnections = configuration.connectionPool().maxActive(); if (maxConnections < 0) { maxConnections = Integer.MAX_VALUE; } ChannelInitializer channelInitializer = new ChannelInitializer(bootstrap, address, operationsFactory, configuration); bootstrap.handler(channelInitializer); ChannelPool pool = new ChannelPool(bootstrap.config().group().next(), address, channelInitializer, configuration.connectionPool().exhaustedAction(), configuration.connectionPool().maxWait(), maxConnections); channelInitializer.setChannelPool(pool); return pool; }
Source:
<code>public String getDeleteDescription() { <START> return getName() + (getAlias() == null ? "" : " (" + getAlias() + ")"); <END> }</code><technical_language>Alias null</technical_language>

Target:
public String getDeleteDescription() { return getName() + " (" + getAlias() + ")"; }