auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String toString() { if (isEmpty()) { return Objects.toStringHelper(this) <START> .addValue("NONE") <END> .toString(); } else { return Objects.toStringHelper(this) .omitNullValues() .add("bold", this.bold.orNull()) .add("italic", this.italic.orNull()) .add("underline", this.underline.orNull()) .add("strikethrough", this.strikethrough.orNull()) .add("obfuscated", this.obfuscated.orNull()) .toString(); } }</code><technical_language>more sense omitNullValues() (and remove NONE) empty TextStyle simply TextStyle{}</technical_language>

Target:
public String toString() { return Objects.toStringHelper(TextStyle.class) .omitNullValues() .add("bold", this.bold.orElse(null)) .add("italic", this.italic.orElse(null)) .add("underline", this.underline.orElse(null)) .add("strikethrough", this.strikethrough.orElse(null)) .add("obfuscated", this.obfuscated.orElse(null)) .toString(); }
Source:
<code>private static boolean checkLocus(final VCFFileReader vcfFileReader, final SamLocusIterator.LocusInfo locusInfo) { <START> boolean overlaps = false; <END> if (locusInfo != null) { try (final CloseableIterator<VariantContext> vcfIterator = vcfFileReader.query(locusInfo)) { overlaps = true; boolean allFiltered = true; while (vcfIterator.hasNext()) { final VariantContext vcf = vcfIterator.next(); if (vcf.isFiltered()) { continue; } allFiltered = false; } if (allFiltered) { overlaps = false; } } } return overlaps; }</code><technical_language>empty lines</technical_language>

Target:
private static boolean checkLocus(final VCFFileReader vcfFileReader, final SamLocusIterator.LocusInfo locusInfo) { boolean overlaps = false; if (locusInfo != null) { try (final CloseableIterator<VariantContext> vcfIterator = vcfFileReader.query(locusInfo)) { while (vcfIterator.hasNext()) { if (vcfIterator.next().isFiltered()) { continue; } overlaps = true; break; } } } return overlaps; }
Source:
<code>public InstructorFeedbackResultsSessionPanel(FeedbackSessionAttributes session, String editLink, FeedbackSessionPublishButton feedbackSessionPublishButton, String selectedSection, boolean isMissingResponsesShown, boolean isStatsShown) { this.courseId = SanitizationHelper.sanitizeForHtml(session.getCourseId()); this.feedbackSessionName = SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()); this.editLink = editLink; this.startTime = TimeHelper.formatDateTimeForHomePage(session.getStartTime(), session.getTimeZone()); <START> this.endTime = TimeHelper.formatDateTimeForHomePage(session.getEndTime(), session.getTimeZone()); <END> this.resultsVisibleFrom = getResultsVisibleFromText(session); this.feedbackSessionPublishButton = feedbackSessionPublishButton; this.selectedSection = selectedSection; this.isStatsShown = isStatsShown; this.isMissingResponsesShown = isMissingResponsesShown; }</code><technical_language>More examples of this is home pages</technical_language>

Target:
public InstructorFeedbackResultsSessionPanel(FeedbackSessionAttributes session, String editLink, FeedbackSessionPublishButton feedbackSessionPublishButton, String selectedSection, boolean isMissingResponsesShown, boolean isStatsShown) { this.courseId = SanitizationHelper.sanitizeForHtml(session.getCourseId()); this.feedbackSessionName = SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()); this.editLink = editLink; this.startTime = TimeHelper.formatDateTimeForDisplay(session.getStartTime(), session.getTimeZone()); this.endTime = TimeHelper.formatDateTimeForDisplay(session.getEndTime(), session.getTimeZone()); this.resultsVisibleFrom = getResultsVisibleFromText(session); this.feedbackSessionPublishButton = feedbackSessionPublishButton; this.selectedSection = selectedSection; this.isStatsShown = isStatsShown; this.isMissingResponsesShown = isMissingResponsesShown; }
Source:
<code>private void updateSecurityContextAuthorities(SecurityContext securityContext, Collection<? extends GrantedAuthority> newAuthorities) { Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); List<GrantedAuthority> updatedAuthorities = new ArrayList<>(authorities); updatedAuthorities.addAll(newAuthorities); Authentication authentication = securityContext.getAuthentication(); <START> UsernamePasswordAuthenticationToken newToken = new UsernamePasswordAuthenticationToken( <END> authentication.getPrincipal(), authentication.getCredentials(), updatedAuthorities); securityContext.setAuthentication(newToken); }</code><technical_language>I means need re-enter 2FA code if 2FA is enabled</technical_language>

Target:
private void updateSecurityContextAuthorities(SecurityContext securityContext, Collection<? extends GrantedAuthority> newAuthorities) { Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); List<GrantedAuthority> updatedAuthorities = new ArrayList<>(authorities); updatedAuthorities.addAll(newAuthorities); Authentication updatedAuthentication = authenticationAuthoritiesUpdater.updateAuthentication( securityContext.getAuthentication(), updatedAuthorities); securityContext.setAuthentication(updatedAuthentication); }
Source:
<code>private String getEffectiveEmulatedMachine() { if (getVm().getCustomEmulatedMachine() != null) { return getVm().getCustomEmulatedMachine(); } String <START> recentDefault = <END> getCluster().getEmulatedMachine(); if (removeThisDebugSwitch && getVm().getCustomCompatibilityVersion() != null) { List<String> oldSupported = Config.<List<String>>getValue(ConfigValues.ClusterEmulatedMachines, getVm().getCustomCompatibilityVersion().getValue()); Optional<String> best = oldSupported.stream().max( (s1, s2) -> StringUtils.indexOfDifference(recentDefault, s1) - StringUtils.indexOfDifference(recentDefault, s2)); log.info("Emulated machine '{}' selected since Custom Compatibility Version is set for the '{}' VM", best.orElse(recentDefault), getVm().getName()); return best.orElse(recentDefault); } return recentDefault; }</code><technical_language>I 'clusterDefault' describe this</technical_language>

Target:
protected String getEffectiveEmulatedMachine() { if (getVm().getCustomEmulatedMachine() != null) { return getVm().getCustomEmulatedMachine(); } String recentClusterDefault = getCluster().getEmulatedMachine(); if (getVm().getCustomCompatibilityVersion() == null) { return recentClusterDefault; } List<String> oldSupported = Config.getValue(ConfigValues.ClusterEmulatedMachines, getVm().getCustomCompatibilityVersion().getValue()); Optional<String> best = oldSupported.stream().max( (s1, s2) -> StringUtils.indexOfDifference(recentClusterDefault, s1) - StringUtils.indexOfDifference(recentClusterDefault, s2)); log.info("Emulated machine '{}' selected since Custom Compatibility Version is set for the '{}' VM", best.orElse(recentClusterDefault), getVm().toString()); return best.orElse(recentClusterDefault); }
Source:
<code>public int getPartition(BytesWritable bytesWritable, Writable value, int numPartitions) { final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes()); bytes.position(4); int shardNum = bytes.getInt(); <START> if (local) { <END> return shardNum % numPartitions; } else { if (shardNum >= numPartitions) { throw new ISE("Not enough partitions, shard[%,d] >= numPartitions[%,d]", shardNum, numPartitions); } return shardNum; } }</code><technical_language>if converting a global instance variable is better, global state is better</technical_language>

Target:
public int getPartition(BytesWritable bytesWritable, Writable value, int numPartitions) { final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes()); bytes.position(4); int shardNum = bytes.getInt(); if (config.get("mapred.job.tracker").equals("local")) { return shardNum % numPartitions; } else { if (shardNum >= numPartitions) { throw new ISE("Not enough partitions, shard[%,d] >= numPartitions[%,d]", shardNum, numPartitions); } return shardNum; } }
Source:
<code>private void initProperties() { List<ConfigurationNode> nodes = getRootNode().getChildren(); if (nodes == null || nodes.isEmpty()) { return; } for (ConfigurationNode p : nodes) { String name = (String) p.getChildren("name").get(0).getValue(); String value = (String) p.getChildren("value").get(0).getValue(); if (!StringUtils.isEmpty(name) && !StringUtils.isEmpty(value)) { <START> properties.put(name, value); <END> } } }</code><technical_language>valid a config/property foo= - is empty</technical_language>

Target:
private void initProperties() { List<ConfigurationNode> nodes = getRootNode().getChildren(); if (nodes == null || nodes.isEmpty()) { return; } for (ConfigurationNode p : nodes) { String name = (String) p.getChildren("name").get(0).getValue(); String value = (String) p.getChildren("value").get(0).getValue(); if (!StringUtils.isEmpty(name)) { properties.put(name, value); } } }
Source:
<code>public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if(bindingConfig.indexOf('.') < 0 && !bindingConfig.equalsIgnoreCase("lightscmd")){ <START> logger.warn("Item has an invalid configuration {}", item.getName(), bindingConfig); <END> return; } AutelisBindingConfig config = new AutelisBindingConfig(bindingConfig); addBindingConfig(item, config); Set<Item> items = contextMap.get(context); if (items == null) { items = new HashSet<Item>(); contextMap.put(context, items); } items.add(item); }</code><technical_language>please add correct syntax statement</technical_language>

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if(bindingConfig.indexOf('.') < 0 && !bindingConfig.equalsIgnoreCase("lightscmd")){ logger.warn("Item {}'s configuration ({}) is not valid, please use the pattern 'parentType.childType' or lightscmd ", item.getName(), bindingConfig); return; } AutelisBindingConfig config = new AutelisBindingConfig(bindingConfig); addBindingConfig(item, config); Set<Item> items = contextMap.get(context); if (items == null) { items = new HashSet<Item>(); contextMap.put(context, items); } items.add(item); }
Source:
<code><START> private boolean stopGlusterServices(VDS vds) { <END> boolean succeeded = true; if (vds.getVdsGroupSupportsGlusterService()) { succeeded = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vds.getId())).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = DbFacade.getInstance().getGlusterBrickDao().getGlusterVolumeBricksByServerId(vds.getId()); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } DbFacade.getInstance().getGlusterBrickDao().updateBrickStatuses(bricks); } } } return succeeded; }</code><technical_language>is for return of this method. please change 'void'</technical_language>

Target:
private void stopGlusterServices(VDS vds) { boolean succeeded = false; if (vds.getVdsGroupSupportsGlusterService()) { succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vds.getId())).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = glusterBrickDao.getGlusterVolumeBricksByServerId(vds.getId()); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } glusterBrickDao.updateBrickStatuses(bricks); } } if(!succeeded){ log.info("Failed to stop gluster services while moving the host '{}' to maintenance", vds.getName()); } } }
Source:
<code>public void testExistingMultipleTagsIteratorGHFileNotFoundExceptionOnHasNext() throws IOException { SCMHeadObserver mockSCMHeadObserver = Mockito.mock(SCMHeadObserver.class); Error expectedError = new Error("Bad Tag Request", new GHFileNotFoundException()); <START> Error expectedError2 = new Error("Bad Tag Request IOError", new IOException()); <END> Mockito.when(mockSCMHeadObserver.getIncludes()).thenReturn( new HashSet<>(Arrays.asList( new GitHubTagSCMHead("existent-multiple-tags1", System.currentTimeMillis()), new GitHubTagSCMHead("existent-multiple-tags2", System.currentTimeMillis())))); GitHubSCMSourceContext context = new GitHubSCMSourceContext(null, mockSCMHeadObserver); context.wantTags(true); GitHubSCMSourceRequest request = context.newRequest(revisions()[0], null); GHRepository repoSpy = Mockito.spy(repo); PagedIterable<GHRef> iterableSpy = Mockito.spy(repoSpy.listRefs("tags")); Mockito.when(repoSpy.listRefs("tags")).thenReturn(iterableSpy); PagedIterator<GHRef> iteratorSpy = Mockito.spy(iterableSpy.iterator()); Mockito.when(iterableSpy.iterator()).thenReturn(iteratorSpy); Mockito.when(iteratorSpy.hasNext()).thenThrow(expectedError); Iterator<GHRef> tags = new GitHubSCMSource.LazyTags(request, repoSpy).iterator(); assertFalse(tags.hasNext()); }</code><technical_language>Remove discussion</technical_language>

Target:
public void testExistingMultipleTagsIteratorGHFileNotFoundExceptionOnHasNext() throws IOException { SCMHeadObserver mockSCMHeadObserver = Mockito.mock(SCMHeadObserver.class); Error expectedError = new Error("Bad Tag Request", new GHFileNotFoundException()); Error expectedError2 = new Error("Bad Tag Request IOError", new IOException()); Mockito.when(mockSCMHeadObserver.getIncludes()).thenReturn( new HashSet<>(Arrays.asList( new GitHubTagSCMHead("existent-multiple-tags1", System.currentTimeMillis()), new GitHubTagSCMHead("existent-multiple-tags2", System.currentTimeMillis())))); GitHubSCMSourceContext context = new GitHubSCMSourceContext(null, mockSCMHeadObserver); context.wantTags(true); GitHubSCMSourceRequest request = context.newRequest(new GitHubSCMSource("cloudbeers", "yolo", null, false), null); GHRepository repoSpy = Mockito.spy(repo); PagedIterable<GHRef> iterableSpy = Mockito.spy(repoSpy.listRefs("tags")); Mockito.when(repoSpy.listRefs("tags")).thenReturn(iterableSpy); PagedIterator<GHRef> iteratorSpy = Mockito.spy(iterableSpy.iterator()); Mockito.when(iterableSpy.iterator()).thenReturn(iteratorSpy); Mockito.when(iteratorSpy.hasNext()).thenThrow(expectedError).thenThrow(expectedError2); Iterator<GHRef> tags = new GitHubSCMSource.LazyTags(request, repoSpy).iterator(); Iterator<GHRef> tags2 = new GitHubSCMSource.LazyTags(request, repoSpy).iterator(); assertFalse(tags.hasNext()); try{ tags.hasNext(); fail("This should throw an exception"); } catch(Error e){ assertEquals("Bad Tag Request IOError", e.getMessage()); } }
Source:
<code>private void shedQueuedOpportunisticContainers() { int numAllowed = this.queuingLimit.getMaxQueueLength(); Iterator<Container> containerIter = queuedOpportunisticContainers.values().iterator(); while (containerIter.hasNext()) { Container container = containerIter.next(); if (numAllowed <= 0) { container.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, <START> "Container Killed to make room for Guaranteed Container."); <END> containerIter.remove(); LOG.info( "Opportunistic container will be killed to meet NM queuing" + " limits.", container.getContainerId()); } numAllowed--; } }</code><technical_language>this diagnostic message similar log below</technical_language>

Target:
private void shedQueuedOpportunisticContainers() { int numAllowed = this.queuingLimit.getMaxQueueLength(); Iterator<Container> containerIter = queuedOpportunisticContainers.values().iterator(); while (containerIter.hasNext()) { Container container = containerIter.next(); if (numAllowed <= 0) { container.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Container De-queued to meet NM queuing limits."); containerIter.remove(); LOG.info( "Opportunistic container will be killed to meet NM queuing" + " limits.", container.getContainerId()); } numAllowed--; } }
Source:
<code>public void path_trie_dot_in_id() { pt.add("ScoreBoard.Rulesets.Rule(Period.Duration)"); pt.add("ScoreBoard.Rulesets.Rule(Jam.*)"); pt.add("ScoreBoard.Rulesets.Rule(Intermission*)"); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Period.Duration)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo.Bar)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Period.Direction)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Jam)")); <START> assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Intermission.Direction)")); <END> }</code><technical_language>Rule(*) cover this</technical_language>

Target:
public void path_trie_dot_in_id() { pt.add("ScoreBoard.Rulesets.Rule(Period.Duration)"); pt.add("ScoreBoard.Rulesets.Rule(Jam.*)"); pt.add("ScoreBoard.Rulesets.Rule(Intermission*)"); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Period.Duration)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam.Foo.Bar)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Period.Direction)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Jam)")); assertFalse(pt.covers("ScoreBoard.Rulesets.Rule(Intermission.Direction)")); pt.add("ScoreBoard.Rulesets.Rule(*)"); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Period.Direction)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Jam)")); assertTrue(pt.covers("ScoreBoard.Rulesets.Rule(Intermission.Direction)")); }
Source:
<code>public Map<String, Criterion> getTeamKillMappings() { <START> return teamKillMappings; <END> }</code><technical_language>this</technical_language>

Target:
public Map<String, Criterion> getTeamKillMappings() { return this.teamKillMappings; }
Source:
<code>public void compactOnLaunch_multipleThread() throws IOException { final String REALM_NAME = "test.realm"; final CountDownLatch bgThreadDoneLatch = new CountDownLatch(1); final AtomicInteger compactOnLaunchCount = new AtomicInteger(0); final RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .name(REALM_NAME) .compactOnLaunch(new CompactOnLaunchCallback() { @Override public boolean shouldCompact(long totalBytes, long usedBytes) { compactOnLaunchCount.incrementAndGet(); return false; } }) .build(); Realm realm = Realm.getInstance(realmConfig); new Thread(new Runnable() { @Override public void run() { Realm bgRealm = Realm.getInstance(realmConfig); bgRealm.close(); bgThreadDoneLatch.countDown(); } <START> }).run(); <END> awaitOrFail(bgThreadDoneLatch); realm.close(); assertEquals(2, compactOnLaunchCount.get()); }</code><technical_language>This is starting another thread, running runnable current thread. need start() thread.join() wait for finish</technical_language>

Target:
public void compactOnLaunch_multipleThread() throws IOException { final String REALM_NAME = "test.realm"; final AtomicInteger compactOnLaunchCount = new AtomicInteger(0); final RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .name(REALM_NAME) .compactOnLaunch(new CompactOnLaunchCallback() { @Override public boolean shouldCompact(long totalBytes, long usedBytes) { compactOnLaunchCount.incrementAndGet(); return true; } }) .build(); Realm realm = Realm.getInstance(realmConfig); Thread thread = new Thread(new Runnable() { @Override public void run() { Realm bgRealm = Realm.getInstance(realmConfig); bgRealm.close(); } }); thread.start(); try { thread.join(); } catch (InterruptedException e) { fail(); } realm.close(); assertNotEquals(1, compactOnLaunchCount.get()); assertEquals(3, compactOnLaunchCount.get()); }
Source:
<code>private void makeComponents() { components = new ArrayList<InputStream>(); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(contentType)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(bodyBytes)); for (Attachment a : attachments) { try { components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(a.getInputStream()); } catch (IOException ioe) { <START> throw new RuntimeException("aargh", ioe); <END> } } components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(trailingBoundary)); }</code><technical_language>need a message :)</technical_language>

Target:
private void makeComponents() { components = new ArrayList<InputStream>(); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(contentType)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(bodyBytes)); for (Attachment a : attachments) { try { components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(partBoundary)); components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(crlf)); components.add(a.getInputStream()); } catch (IOException ioe) { deferrredException = ioe; } } components.add(new ByteArrayInputStream(crlf)); components.add(new ByteArrayInputStream(trailingBoundary)); }
Source:
<code>private void createMappingTable() { <START> ResultSet resultset = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name='openshift_metrics' AND table_name='metrics_mappings';"); <END> if (resultset.all().isEmpty()) { session.execute("CREATE TABLE openshift_metrics.metrics_mappings (project_id text PRIMARY KEY, project_name text);"); } }</code><technical_language>If hasMappingTable, point of rechecking</technical_language>

Target:
private void createMappingTable() { session.execute("CREATE TABLE IF NOT EXISTS openshift_metrics.metrics_mappings (project_id text PRIMARY KEY, project_name text) WITH compaction = { 'class' : 'LeveledCompactionStrategy' };"); }
Source:
<code>public void testComplexPropertyChangedNegative() { final ComplexPropertyCollection<ComplexProperty> collection = createFakeComplexPropertyCollection(); collection.complexPropertyChanged(null); <START> Assert.fail(); <END> }</code><technical_language>_side note:_ unnecessary RuntimeException thrown test fail</technical_language>

Target:
public void testComplexPropertyChangedNegative() { final ComplexPropertyCollection<ComplexProperty> collection = createFakeComplexPropertyCollection(); collection.complexPropertyChanged(null); }
Source:
<code>protected void getDowntime() { <START> if (getVm() != null && getVm().getStatus() == VMStatus.Up) { <END> try { VDSReturnValue retVal = runVdsCommand(VDSCommandType.MigrateStatus, new MigrateStatusVDSCommandParameters(getDestinationVdsId(), getVmId())); if (retVal != null) { actualDowntime = (Integer) retVal.getReturnValue(); } } catch (VdcBLLException e) { migrationErrorCode = e.getErrorCode(); } } }</code><technical_language>1. I is needed check VM is null - is locked, remove 2. is important status is up? if is powering-up</technical_language>

Target:
protected void getDowntime() { try { VDSReturnValue retVal = runVdsCommand(VDSCommandType.MigrateStatus, new MigrateStatusVDSCommandParameters(getDestinationVdsId(), getVmId())); if (retVal != null) { actualDowntime = (Integer) retVal.getReturnValue(); } } catch (VdcBLLException e) { migrationErrorCode = e.getErrorCode(); } }
Source:
<code>protected List<Blob> handleNewRendition(String key, DocumentModel doc, RenditionDefinition definition, String sourceDocumentModificationDate) { Work work = getRenditionWork(key, doc, definition); if (log.isDebugEnabled()) { log.debug(String.format( "No entry found for key %s in the %s transient store, scheduling rendition work with id %s and storing an empty blob for now.", key, CACHE_NAME, work.getId())); } if (sourceDocumentModificationDate != null) { getTransientStore().putParameter(key, SOURCE_DOCUMENT_MODIFICATION_DATE_KEY, sourceDocumentModificationDate); } List<Blob> blobs = new ArrayList<>(); StringBlob emptyBlob = new StringBlob(""); emptyBlob.setFilename(LazyRendition.IN_PROGRESS_MARKER); emptyBlob.setMimeType("text/plain;" + LazyRendition.EMPTY_MARKER); blobs.add(emptyBlob); <START> getTransientStore().putBlobs(key, blobs); <END> Framework.getService(WorkManager.class).schedule(work, Scheduling.IF_NOT_SCHEDULED); return getTransientStore().getBlobs(key); }</code><technical_language>blobs replaced Collections.singletonList(emptyBlob)</technical_language>

Target:
protected List<Blob> handleNewRendition(String key, DocumentModel doc, RenditionDefinition definition, String sourceDocumentModificationDate) { Work work = getRenditionWork(key, doc, definition); if (log.isDebugEnabled()) { log.debug(String.format( "No entry found for key %s in the %s transient store, scheduling rendition work with id %s and storing an empty blob for now.", key, CACHE_NAME, work.getId())); } if (sourceDocumentModificationDate != null) { getTransientStore().putParameter(key, SOURCE_DOCUMENT_MODIFICATION_DATE_KEY, sourceDocumentModificationDate); } StringBlob emptyBlob = new StringBlob(""); emptyBlob.setFilename(LazyRendition.IN_PROGRESS_MARKER); emptyBlob.setMimeType("text/plain;" + LazyRendition.EMPTY_MARKER); getTransientStore().putBlobs(key, Collections.singletonList(emptyBlob)); Framework.getService(WorkManager.class).schedule(work, Scheduling.IF_NOT_SCHEDULED); return Collections.singletonList(emptyBlob); }
Source:
<code>public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { return PomUtils.hasSnapshot(mavenProject.getVersion()) ? <START> Lists.<ConnectorIssue>newArrayList() : <END> Lists.newArrayList(new ConnectorIssue(KEY, String.format("Project artifact (%s) MUST have a SNAPSHOT. Current version is (%s) but it should be (%s-SNAPSHOT).", mavenProject.getArtifactId(), mavenProject.getVersion(), mavenProject.getVersion()))); }</code><technical_language>java Collections.emptyList()</technical_language>

Target:
public Iterable<ConnectorIssue> analyze(MavenProject mavenProject) { return PomUtils.hasSnapshot(mavenProject.getVersion()) ? Collections.<ConnectorIssue>emptyList() : Lists.newArrayList(new ConnectorIssue(KEY, String.format("Project artifact (%s) MUST have a SNAPSHOT. Current version is (%s) but it should be (%s-SNAPSHOT).", mavenProject.getArtifactId(), mavenProject.getVersion(), mavenProject.getVersion()))); }
Source:
<code>public void clickPublishButtonDropdown() { scrollAndClick(cssPublishButtonDropdown); PageObjectLogging.log("clickCssPublishButton", "click on publish button dropdown", true); <START> waitForElementByElement(cssPublishButtonDropdown); <END> }</code><technical_language>is reason wait for element clicking it? if please remove method :)</technical_language>

Target:
public void clickPublishButtonDropdown() { scrollAndClick(cssPublishButtonDropdown); PageObjectLogging.log("clickCssPublishButton", "click on publish button dropdown", true); }
Source:
<code>public static AbstractCharSequenceAssert<?, ? extends CharSequence> assertThat(StringBuffer actual) { <START> return new CharSequenceAssert(actual); <END> }</code><technical_language>in AssertionsForClassTypes.assertThat(actual); current code moved AssertionsForClassTypes (as done for assertThat(String actual))</technical_language>

Target:
public static AbstractCharSequenceAssert<?, ? extends CharSequence> assertThat(StringBuffer actual) { return AssertionsForClassTypes.assertThat(actual); }
Source:
<code>protected void testForbiddenImpersonation(String admin, String adminRealm) { Keycloak client = createAdminClient(adminRealm, establishClientId(adminRealm), admin); try { client.realms().realm("test").users().get(impersonatedUserId).impersonate(); Assert.fail("Expected ClientErrorException wasn't thrown."); } catch (ClientErrorException e) { <START> Assert.assertTrue(e.getMessage().contains("403 Forbidden")); <END> } finally { client.close(); } }</code><technical_language>suggestion Assert.assertThat(e.getMessage(), containsString("403 Forbidden")); - get error message if fails</technical_language>

Target:
protected void testForbiddenImpersonation(String admin, String adminRealm) { try (Keycloak client = createAdminClient(adminRealm, establishClientId(adminRealm), admin)) { client.realms().realm("test").users().get(impersonatedUserId).impersonate(); Assert.fail("Expected ClientErrorException wasn't thrown."); } catch (ClientErrorException e) { Assert.assertThat(e.getMessage(), containsString("403 Forbidden")); } }
Source:
<code>public void run() { if (entrancePi == null) throw new IllegalStateException("You need to set entrance PI before run the topology."); while(entrancePi.injectNextEvent()) { <START> if (this.getSourceDelay() > 0) { <END> try { Thread.sleep(this.getSourceDelay()); } catch (InterruptedException e) { logger.error("Topology was interrupted while sleeping."); } } } }</code><technical_language>This source throttling works for multithreaded engine. However, a common solution for engines, leave this duty EntranceProcessor implementation</technical_language>

Target:
public void run() { ThreadsEntranceProcessingItem entrancePi = (ThreadsEntranceProcessingItem) this.getEntranceProcessingItem(); if (entrancePi == null) throw new IllegalStateException("You need to set entrance PI before running the topology."); this.setupProcessingItemInstances(); entrancePi.getProcessor().onCreate(0); entrancePi.startSendingEvents(); }
Source:
<code>public boolean readsExistingValues() { <START> return putIfAbsent || flags == null || !flags.contains(Flag.IGNORE_RETURN_VALUES); <END> }</code><technical_language>hasFlag() consistent other commands</technical_language>

Target:
public boolean readsExistingValues() { return putIfAbsent || !hasFlag(Flag.IGNORE_RETURN_VALUES); }
Source:
<code>public List<SampleList> getAllTopLevelLists(final String programUUID) { try { final Criterion topFolder = Restrictions.like("hierarchy.listName", SampleListDao.ROOT_FOLDER); final Criterion nullFolder = Restrictions.isNull("hierarchy"); final Criteria criteria = this.getSession().createCriteria(SampleList.class); criteria.createAlias("hierarchy", "hierarchy"); <START> criteria.add(Restrictions.or(topFolder, nullFolder)); <END> this.addCriteriaForProgramUUIDInLists(programUUID, criteria); criteria.addOrder(Order.asc("listName")); return criteria.list(); } catch (final HibernateException e) { this.logAndThrowException("Error with getAllTopLevelLists() query from SampleList: " + e.getMessage(), e); } return new ArrayList<>(); }</code><technical_language>do this? sql final Criteria criteria = this.getSession().createCriteria(SampleList.class); criteria.add(Restrictions.isNull("hierarchy"));</technical_language>

Target:
public List<SampleList> getAllTopLevelLists(final String programUUID) { final Criteria criteria; try { final Criterion topFolder = Restrictions.like("hierarchy.listName", SampleListDao.ROOT_FOLDER); final Criterion nullFolder = Restrictions.isNull("hierarchy"); criteria = this.getSession().createCriteria(SampleList.class); criteria.createAlias("hierarchy", "hierarchy"); criteria.add(Restrictions.or(topFolder, nullFolder)); this.addCriteriaForProgramUUIDInLists(programUUID, criteria); criteria.addOrder(Order.asc("listName")); } catch (final HibernateException e) { throw new MiddlewareQueryException("Error with getAllTopLevelLists() query from SampleList: " + e.getMessage(), e); } return criteria.list(); }
Source:
<code>public ArithmeticPostAggregator( @JsonProperty("name") String name, @JsonProperty("fn") String fnName, @JsonProperty("fields") List<PostAggregator> fields, @JsonProperty("ordering") String ordering ) { Preconditions.checkArgument(fnName != null, "fn cannot not be null"); this.name = name; this.fnName = fnName; this.fields = fields; this.binary = BinaryOp.lookup(fnName); this.unary = UnaryOp.lookup(fnName); if (binary != null) { Preconditions.checkArgument( fields != null && fields.size() >= 2, "Illegal number of fields[%s], must be >= 2" ); } else if (unary != null) { Preconditions.checkArgument( fields != null && fields.size() == 1, "Illegal number of fields[%s], must be == 1" ); } else { <START> throw new IAE("Unknown operation[%s], known operations[%s and %s] ", fnName, UnaryOp.getFns(), BinaryOp.getFns()); <END> } this.function = toFunction(); this.ordering = ordering; this.comparator = ordering == null ? DEFAULT_COMPARATOR : Ordering.valueOf(ordering); }</code><technical_language>i pending PRs for <LINK_1> <LINK_0> for this in general way. do cover case of binary/unary op here? I cover this case well</technical_language>

Target:
public ArithmeticPostAggregator( @JsonProperty("name") String name, @JsonProperty("fn") String fnName, @JsonProperty("fields") List<PostAggregator> fields, @JsonProperty("ordering") String ordering ) { Preconditions.checkArgument(fnName != null, "fn cannot not be null"); Preconditions.checkArgument(fields != null && fields.size() > 1, "Illegal number of fields[%s], must be > 1"); this.name = name; this.fnName = fnName; this.fields = fields; this.op = Ops.lookup(fnName); if (op == null) { throw new IAE("Unknown operation[%s], known operations[%s]", fnName, Ops.getFns()); } this.ordering = ordering; this.comparator = ordering == null ? DEFAULT_COMPARATOR : Ordering.valueOf(ordering); }
Source:
<code>private List<DataValue> generateReportDataValues(Long transfusionSiteId, Date startDate, Date endDate) { List<TransfusionSummaryDTO> dtos = transfusionRepository.findTransfusionSummaryRecordedForUsageSiteForPeriod(transfusionSiteId, startDate, endDate); List<DataValue> dataValues = new ArrayList<>(dtos.size()); for (TransfusionSummaryDTO dto : dtos) { DataValue dataValue = new DataValue(); dataValue.setStartDate(startDate); dataValue.setEndDate(endDate); dataValue.setLocation(locationFactory.createViewModel(dto.getTransfusionSite())); dataValue.setValue(dto.getCount()); Cohort transfusionReactionTypeCohort = new Cohort(); transfusionReactionTypeCohort.setCategory(CohortConstants.TRANSFUSION_REACTION_TYPE_CATEGORY); transfusionReactionTypeCohort.setComparator(Comparator.EQUALS); <START> transfusionReactionTypeCohort.setOption(dto.getTransfusionReactionType().getName()); <END> dataValue.addCohort(transfusionReactionTypeCohort); Cohort transfusionOutcomeCohort = new Cohort(); transfusionOutcomeCohort.setCategory(CohortConstants.TRANSFUSION_OUTCOME_CATEGORY); transfusionOutcomeCohort.setComparator(Comparator.EQUALS); transfusionOutcomeCohort.setOption(dto.getTransfusionOutcome()); dataValue.addCohort(transfusionOutcomeCohort); dataValues.add(dataValue); } return dataValues; }</code><technical_language>a TransfusionReactionType - depend TransfusionOutcome. If TransfusionOutcome.TRANSFUSION_REACTION_OCCURRED expect a reaction, null</technical_language>

Target:
private List<DataValue> generateReportDataValues(Long transfusionSiteId, Date startDate, Date endDate) { List<TransfusionSummaryDTO> dtos = transfusionRepository.findTransfusionSummaryRecordedForUsageSiteForPeriod(transfusionSiteId, startDate, endDate); List<DataValue> dataValues = new ArrayList<>(dtos.size()); for (TransfusionSummaryDTO dto : dtos) { DataValue dataValue = new DataValue(); dataValue.setStartDate(startDate); dataValue.setEndDate(endDate); dataValue.setLocation(locationFactory.createViewModel(dto.getTransfusionSite())); dataValue.setValue(dto.getCount()); Cohort transfusionReactionTypeCohort = new Cohort(); transfusionReactionTypeCohort.setCategory(CohortConstants.TRANSFUSION_REACTION_TYPE_CATEGORY); transfusionReactionTypeCohort.setComparator(Comparator.EQUALS); if (dto.getTransfusionReactionType() != null) { transfusionReactionTypeCohort.setOption(dto.getTransfusionReactionType().getName()); } dataValue.addCohort(transfusionReactionTypeCohort); Cohort transfusionOutcomeCohort = new Cohort(); transfusionOutcomeCohort.setCategory(CohortConstants.TRANSFUSION_OUTCOME_CATEGORY); transfusionOutcomeCohort.setComparator(Comparator.EQUALS); transfusionOutcomeCohort.setOption(dto.getTransfusionOutcome()); dataValue.addCohort(transfusionOutcomeCohort); dataValues.add(dataValue); } return dataValues; }
Source:
<code>private void validatePlanExecution(MigrationDefinition definition, Plan plan) throws InvalidMigrationException { <START> if (!kieService.existsProcessDefinition(plan.getSourceContainerId(), plan.getTargetProcessId(), definition.getKieserverId())) { <END> throw new ProcessNotFoundException(plan.getSourceContainerId()); } if (!kieService.existsProcessDefinition(plan.getTargetContainerId(), plan.getTargetProcessId(), definition.getKieserverId())) { throw new ProcessNotFoundException(plan.getTargetContainerId()); } }</code><technical_language>needed? check if a target process definition exists in source container</technical_language>

Target:
private void validatePlanExecution(MigrationDefinition definition, Plan plan) throws InvalidMigrationException { if (!kieService.existsProcessDefinition(plan.getSourceContainerId(), plan.getTargetProcessId(), definition.getKieserverId())) { throw new ProcessNotFoundException(plan.getSourceContainerId()); } }
Source:
<code>public void compact(OutputStream out) throws IOException { MergedReftable mr = new MergedReftable(new ArrayList<>(tables)); mr.setIncludeDeletes(includeDeletes); <START> writer.setMinUpdateIndex(minUpdateIndex); <END> writer.setMaxUpdateIndex(maxUpdateIndex); writer.begin(out); mergeRefs(mr); mergeLogs(mr); writer.finish(); stats = writer.getStats(); }</code><technical_language>Is for minUpdateIndex -1 this point? e.g. check for throw IllegalStateException? minUpdateIndex maxUpdateIndex if refs write? Is a caller error is a case up</technical_language>

Target:
public void compact(OutputStream out) throws IOException { MergedReftable mr = new MergedReftable(new ArrayList<>(tables)); mr.setIncludeDeletes(includeDeletes); minUpdateIndex = Math.max(minUpdateIndex, 0); writer.setMinUpdateIndex(minUpdateIndex); writer.setMaxUpdateIndex(maxUpdateIndex); writer.begin(out); mergeRefs(mr); mergeLogs(mr); writer.finish(); stats = writer.getStats(); }
Source:
<code>default List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull) { <START> throw new PrestoException(NOT_SUPPORTED, "This connector does not support list tables"); <END> }</code><technical_language>this return empty list. legitimate for a connector enumerate tables (we do this default methods new in Java 8)</technical_language>

Target:
default List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull) { return emptyList(); }
Source:
<code>public void requestResults(String query, Searcher searcher) { StringNormalizer.Result queryNormalized = StringNormalizer.normalizeWithResult(query, false); queryNormalized = queryNormalized.replaceAll(Character.codePointAt("-", 0), Character.codePointAt(" ", 0)); FuzzyScore fuzzyScore = new FuzzyScore(queryNormalized.codePoints); FuzzyScore.MatchInfo matchInfo = new FuzzyScore.MatchInfo(); for (ContactsPojo pojo : pojos) { boolean match = fuzzyScore.match(pojo.normalizedName.codePoints, matchInfo); pojo.relevance = matchInfo.score; if (match) { List<Pair<Integer, Integer>> positions = matchInfo.getMatchedSequences(); try { pojo.setNameHighlight(positions); } catch (Exception e) { pojo.setNameHighlight(0, pojo.normalizedName.length()); } } if (!pojo.nickname.isEmpty()) { if (fuzzyScore.match(pojo.nickname, matchInfo)) { if (!match || (matchInfo.score > pojo.relevance)) { match = true; pojo.relevance = matchInfo.score; pojo.setNameHighlight(0, 0); } } } if (!match && queryNormalized.length() > 2) { if (fuzzyScore.match(pojo.phoneSimplified, matchInfo)) { match = true; pojo.relevance = matchInfo.score; <START> pojo.setNameHighlight(0, 0); <END> } } if (match) { pojo.relevance += Math.min(15, pojo.timesContacted); if(pojo.starred) { pojo.relevance += 15; } if (!searcher.addResult(pojo)) return; } } }</code><technical_language>clearNameHighlight() instead</technical_language>

Target:
public void requestResults(String query, Searcher searcher) { StringNormalizer.Result queryNormalized = StringNormalizer.normalizeWithResult(query, false); queryNormalized = queryNormalized.replaceAll(Character.codePointAt("-", 0), Character.codePointAt(" ", 0)); FuzzyScore fuzzyScore = new FuzzyScore(queryNormalized.codePoints); FuzzyScore.MatchInfo matchInfo = new FuzzyScore.MatchInfo(); for (ContactsPojo pojo : pojos) { boolean match = fuzzyScore.match(pojo.normalizedName.codePoints, matchInfo); pojo.relevance = matchInfo.score; if (match) { List<Pair<Integer, Integer>> positions = matchInfo.getMatchedSequences(); try { pojo.setNameHighlight(positions); } catch (Exception e) { pojo.setNameHighlight(0, pojo.normalizedName.length()); } } if (!pojo.nickname.isEmpty()) { if (fuzzyScore.match(pojo.nickname, matchInfo)) { if (!match || (matchInfo.score > pojo.relevance)) { match = true; pojo.relevance = matchInfo.score; pojo.clearNameHighlight(); } } } if (!match && queryNormalized.length() > 2) { if (fuzzyScore.match(pojo.phoneSimplified, matchInfo)) { match = true; pojo.relevance = matchInfo.score; pojo.clearNameHighlight(); } } if (match) { pojo.relevance += Math.min(15, pojo.timesContacted); if(pojo.starred) { pojo.relevance += 15; } if (!searcher.addResult(pojo)) return; } } }
Source:
<code>public void createContainerWithShmVolume() { try ( BrowserWebDriverContainer webDriverContainer = new BrowserWebDriverContainer() ) { webDriverContainer.start(); <START> assertEquals("Shm mounts present", webDriverContainer.getContainerInfo().getMounts().size(), 1); <END> final InspectContainerResponse.Mount shmMount = webDriverContainer.getContainerInfo().getMounts().get(0); assertEquals("Shm mount source is correct", "/dev/shm", shmMount.getSource()); assertEquals("Shm mount destination is correct", "/dev/shm", shmMount.getDestination().getPath()); assertEquals("Shm mount mode is correct", shmMount.getMode(), "rw"); } }</code><technical_language>nit: I extract webDriverContainer.getContainerInfo().getMounts() variable :)</technical_language>

Target:
public void createContainerWithShmVolume() { try ( BrowserWebDriverContainer webDriverContainer = new BrowserWebDriverContainer() ) { webDriverContainer.start(); final List<InspectContainerResponse.Mount> mounts = webDriverContainer.getContainerInfo().getMounts(); assertEquals("Shm mounts present", mounts.size(), 1); final InspectContainerResponse.Mount shmMount = mounts.get(0); assertEquals("Shm mount source is correct", "/dev/shm", shmMount.getSource()); assertEquals("Shm mount destination is correct", "/dev/shm", shmMount.getDestination().getPath()); assertEquals("Shm mount mode is correct", shmMount.getMode(), "rw"); } }
Source:
<code>private boolean checkForMeteredCondition() { boolean reconnectMeteredConnection = preferences.getBoolean( getString(R.string.preference_reconnect_metered), false); ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); <START> return reconnectMeteredConnection || !(Build.VERSION.SDK_INT>16 && connManager.isActiveNetworkMetered()); <END> }</code><technical_language>Build.VERSION_CODES constants instead of int 16</technical_language>

Target:
private boolean checkForMeteredCondition() { boolean reconnectMeteredConnection = preferences.getBoolean( getString(R.string.preference_reconnect_metered), false); ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); return reconnectMeteredConnection || !(Build.VERSION.SDK_INT>Build.VERSION_CODES.JELLY_BEAN && connManager.isActiveNetworkMetered()); }
Source:
<code><START> public TmfCoreTracer() { <END> }</code><technical_language>If constructor, automatically get this default (public, parameter). want a *private* constructor, instantiates this class</technical_language>

Target:
private TmfCoreTracer() { }
Source:
<code><START> public static IType createType(ICPPASTInitCapture capture) { <END> IASTInitializer initializer = capture.getDeclarator().getInitializer(); if (initializer instanceof ICPPASTInitializerList) { IType type = ((ICPPASTInitializerList) initializer).getEvaluation().getType(); if (type instanceof InitializerListType) { ICPPEvaluation[] clauses = ((InitializerListType) type).getEvaluation().getClauses(); if (clauses.length == 1) { return clauses[0].getType(); } } } else if (initializer instanceof ICPPASTConstructorInitializer) { IASTInitializerClause[] arguments = ((ICPPASTConstructorInitializer) initializer).getArguments(); if (arguments.length == 1) { return initalizerClauseType(arguments[0]); } } else if (initializer instanceof IASTEqualsInitializer) { return initalizerClauseType(((IASTEqualsInitializer) initializer).getInitializerClause()); } return ProblemType.CANNOT_DEDUCE_AUTO_TYPE; }</code><technical_language>logic in this function correct. standard specifies type of init-capture in terms of 'auto' type deduction rules, reuse 'auto' type deduction logic. If factor out logic in this 'else' branch [1] a helper function getAutoInitClauseForDeclarator() takes a declarator returns ICPPASTInitializerClause, compute type follows: IASTDeclarator declarator = capture.getDeclarator(); ICPPASTInitializerClause initClause = getAutoInitClauseForDeclarator(declarator); if (initClause == null) { return ProblemType.CANNOT_DEDUCE_AUTO_TYPE; } return createAutoType(initClause.getEvaluation(), null, declarator); [1] <LINK_0></technical_language>

Target:
public static IType createType(ICPPASTInitCapture capture) { IASTDeclarator declarator = capture.getDeclarator(); ICPPASTInitializerClause initClause = getAutoInitClauseForDeclarator(declarator); if (initClause == null) { return ProblemType.CANNOT_DEDUCE_AUTO_TYPE; } return createAutoType(initClause.getEvaluation(), null, declarator); }
Source:
<code>public static GridData setButtonLayoutData(Button button) { button.setFont(JFaceResources.getDialogFont()); GC gc = new GC(button); <START> gc.setFont(button.getFont()); <END> FontMetrics fontMetrics = gc.getFontMetrics(); gc.dispose(); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH); Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); data.widthHint = Math.max(widthHint, minSize.x); button.setLayoutData(data); return data; }</code><technical_language>In DialogPage, font is (initializeDialogUnits) is JFaceResources.getDialogFont(). Here, button font. In LocationPage.createControl, Dialog.applyDialogFont is called end, recursively changes fonts of controls. means font is set button this method is called is necessarily final font. So, question is if this method JFaceResources.getDialogFont() if font passed caller</technical_language>

Target:
public static void setButtonLayoutData(Button button) { GC gc = new GC(button); gc.setFont(JFaceResources.getDialogFont()); FontMetrics fontMetrics = gc.getFontMetrics(); gc.dispose(); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH); Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); data.widthHint = Math.max(widthHint, minSize.x); button.setLayoutData(data); }