auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean createButtons(FormToolkit toolkit, Composite sectionClient) { String[] enabledSettings = getEnabledSettings(IDEWorkbenchPlugin .getDefault().getDialogSettings() .getSection(WORKBENCH_SETTINGS)); for (final IConfigurationElement <START> setting : <END> SettingsTransfer.getSettingsTransfers()) { final Button button = toolkit.createButton(sectionClient, setting.getAttribute(ATT_NAME), SWT.CHECK); String helpId = setting.getAttribute(ATT_HELP_CONTEXT); if (helpId != null) PlatformUI.getWorkbench().getHelpSystem().setHelp(button, helpId); if (enabledSettings != null && enabledSettings.length > 0) { String id = setting.getAttribute(ATT_ID); for (String enabledSetting : enabledSettings) { if (enabledSetting.equals(id)) { button.setSelection(true); selectedSettings.add(setting); break; } } } button.setBackground(sectionClient.getBackground()); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (button.getSelection()) selectedSettings.add(setting); else selectedSettings.remove(setting); } }); } return enabledSettings != null && enabledSettings.length > 0; }</code><technical_language>original code called this 'settingsTransfer', reason change it</technical_language>

Target:
private boolean createButtons(FormToolkit toolkit, Composite sectionClient) { String[] enabledSettings = getEnabledSettings(IDEWorkbenchPlugin .getDefault().getDialogSettings() .getSection(WORKBENCH_SETTINGS)); for (final IConfigurationElement settingsTransfer : SettingsTransfer.getSettingsTransfers()) { final Button button = toolkit.createButton(sectionClient, settingsTransfer.getAttribute(ATT_NAME), SWT.CHECK); String helpId = settingsTransfer.getAttribute(ATT_HELP_CONTEXT); if (helpId != null) PlatformUI.getWorkbench().getHelpSystem().setHelp(button, helpId); if (enabledSettings != null && enabledSettings.length > 0) { String id = settingsTransfer.getAttribute(ATT_ID); for (String enabledSetting : enabledSettings) { if (enabledSetting.equals(id)) { button.setSelection(true); selectedSettings.add(settingsTransfer); break; } } } button.setBackground(sectionClient.getBackground()); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (button.getSelection()) selectedSettings.add(settingsTransfer); else selectedSettings.remove(settingsTransfer); } }); } return enabledSettings != null && enabledSettings.length > 0; }
Source:
<code><START> public void interruptThreadAfterTimeout() { <END> final AtomicLong real = new AtomicLong(); final long allowed = 1040; final CountDownLatch latch = new CountDownLatch(1); final Back timeBack = new BkTimeable( new Back() { @Override public void accept(final Socket socket) throws IOException { final long start = System.currentTimeMillis(); while (!Thread.currentThread().isInterrupted()) { real.set(System.currentTimeMillis() - start); } } }, 1000 ); final Thread caller = new Thread( new Runnable() { @Override public void run() { try { timeBack.accept(new Socket()); } catch (final IOException ex) { throw new IllegalArgumentException(ex); } } } ); caller.start(); try { latch.await(allowed, TimeUnit.MILLISECONDS); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } MatcherAssert.assertThat( "Thread run over allowed time limit.", real.get() <= allowed ); }</code><technical_language>@eg04lt3r rename interruptsThreadAfterTimeout</technical_language>

Target:
public void interruptThreadAfterTimeout() { final AtomicLong real = new AtomicLong(); final long allowed = 1040; final long sleep = 50; final CountDownLatch latch = new CountDownLatch(1); final Back back = new BkTimeable( new Back() { @Override public void accept(final Socket socket) throws IOException { final long start = System.currentTimeMillis(); while (!Thread.currentThread().isInterrupted()) { real.set(System.currentTimeMillis() - start); try { TimeUnit.MILLISECONDS.sleep(sleep); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); } } } }, 1000 ); final Thread caller = new Thread( new Runnable() { @Override public void run() { try { back.accept(new Socket()); } catch (final IOException ex) { throw new IllegalArgumentException(ex); } } } ); caller.start(); try { final boolean elapsed = latch.await(allowed, TimeUnit.MILLISECONDS); MatcherAssert.assertThat( "Thread run over allowed time limit.", !elapsed ); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } }
Source:
<code>public ExecRow call(ExecRow locatedRow) throws Exception { getOperation().setCurrentRow(locatedRow); getOperation().setCurrentRowLocation(new HBaseRowLocation(locatedRow.getKey())); <START> getOperation().setCurrentBaseRowLocation(locatorFunction.call(operationContext)); <END> StreamLogUtils.logOperationRecord(locatedRow, operationContext); return locatedRow; }</code><technical_language>setting this unconditionally, for "FOR UPDATE" statements. Is restrict it</technical_language>

Target:
public ExecRow call(ExecRow locatedRow) throws Exception { getOperation().setCurrentRow(locatedRow); getOperation().setCurrentRowLocation(new HBaseRowLocation(locatedRow.getKey())); if(getOperation().isForUpdate()) { getOperation().setCurrentBaseRowLocation(locatorFunction.apply(operationContext)); } StreamLogUtils.logOperationRecord(locatedRow, operationContext); return locatedRow; }
Source:
<code>protected void initializeConnection() { Assert.state(getDataSource() != null, "DataSource must not be null."); try { if (useSharedExtendedConnection) { if (!(getDataSource() instanceof ExtendedConnectionDataSourceProxy)) { throw new InvalidDataAccessApiUsageException( "You must use a ExtendedConnectionDataSourceProxy for the dataSource when " + "useSharedExtendedConnection is set to true."); } this.con = DataSourceUtils.getConnection(dataSource); ((ExtendedConnectionDataSourceProxy)dataSource).startCloseSuppression(this.con); } else { this.con = dataSource.getConnection(); } if (this.connectionAutoCommit != null && this.con.getAutoCommit() != this.connectionAutoCommit) { this.con.setAutoCommit(this.connectionAutoCommit); <START> } <END> } catch (SQLException se) { close(); throw getExceptionTranslator().translate("Executing query", getSql(), se); } }</code><technical_language>If allow this, need set done it</technical_language>

Target:
protected void initializeConnection() { Assert.state(getDataSource() != null, "DataSource must not be null."); try { if (useSharedExtendedConnection) { if (!(getDataSource() instanceof ExtendedConnectionDataSourceProxy)) { throw new InvalidDataAccessApiUsageException( "You must use a ExtendedConnectionDataSourceProxy for the dataSource when " + "useSharedExtendedConnection is set to true."); } this.con = DataSourceUtils.getConnection(dataSource); ((ExtendedConnectionDataSourceProxy)dataSource).startCloseSuppression(this.con); } else { this.con = dataSource.getConnection(); } if (this.connectionAutoCommit != null && this.con.getAutoCommit() != this.connectionAutoCommit) { this.initialConnectionAutoCommit = this.con.getAutoCommit(); this.con.setAutoCommit(this.connectionAutoCommit); } } catch (SQLException se) { close(); throw getExceptionTranslator().translate("Executing query", getSql(), se); } }
Source:
<code>public void addRemoteReplicaToLagMetrics(final RemoteReplicaInfo remoteReplicaInfo) { Gauge<Long> replicaLag = new Gauge<Long>() { @Override public Long getValue() { <START> return remoteReplicaInfo.getReplicaLag(); <END> } }; registry.register(MetricRegistry.name(ReplicationMetrics.class, remoteReplicaInfo.getReplicaId() + "-replicaLag"), replicaLag); replicaLags.add(replicaLag); }</code><technical_language>getReplicaLagInBytes</technical_language>

Target:
public void addRemoteReplicaToLagMetrics(final RemoteReplicaInfo remoteReplicaInfo) { Gauge<Long> replicaLag = new Gauge<Long>() { @Override public Long getValue() { return remoteReplicaInfo.getReplicaLagInBytes(); } }; registry.register( MetricRegistry.name(ReplicationMetrics.class, remoteReplicaInfo.getReplicaId() + "-replicaLagInBytes"), replicaLag); replicaLagInBytes.add(replicaLag); }
Source:
<code>public void testListSecurityGroupsInLocation() { HttpRequest list = HttpRequest.builder().method("GET").endpoint( URI.create("<LINK_0>")).headers( ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token", authToken).build()).build(); HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload( payloadFromResource("/securitygroup_list.json")).build(); Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder(); requestResponseMap.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess); requestResponseMap.put(extensionsOfNovaRequest, extensionsOfNovaResponse); requestResponseMap.put(list, listResponse).build(); SecurityGroupExtension extension = requestsSendResponses(requestResponseMap.build()).getSecurityGroupExtension().get(); Set<SecurityGroup> groups = extension.listSecurityGroupsInLocation(new LocationBuilder() .scope(LocationScope.ZONE) .id(zone) .description("zone") .build()); <START> assertEquals(1, groups.size()); <END> }</code><technical_language>assertEquals(boolean actual, boolean expected)</technical_language>

Target:
public void testListSecurityGroupsInLocation() { HttpRequest list = HttpRequest.builder().method("GET").endpoint( URI.create("<LINK_0>")).headers( ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token", authToken).build()).build(); HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload( payloadFromResource("/securitygroup_list.json")).build(); Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder(); requestResponseMap.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess); requestResponseMap.put(extensionsOfNovaRequest, extensionsOfNovaResponse); requestResponseMap.put(list, listResponse).build(); SecurityGroupExtension extension = requestsSendResponses(requestResponseMap.build()).getSecurityGroupExtension().get(); Set<SecurityGroup> groups = extension.listSecurityGroupsInLocation(new LocationBuilder() .scope(LocationScope.ZONE) .id(zone) .description("zone") .build()); assertEquals(groups.size(), 1); }
Source:
<code>public Fragment getFirstFragment() { <START> return new MyCourseListFragment(); <END> }</code><technical_language>minor (ignore if worth ): name of activity is My**Courses**ListActivity name of fragment is My**Course**ListFragment, **Course** **Courses** in names</technical_language>

Target:
public Fragment getFirstFragment() { return new MyCoursesListFragment(); }
Source:
<code>public void testVpnMsgOrLinkToBrowser() throws Exception { doReturn(mNetwork).when(sMockConnectivityManager).getActiveNetwork(); final NetworkCapabilities nc = new NetworkCapabilities(); doReturn(nc).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); final String continueMsg = mActivity.getString(R.string.ssl_error_continue); <START> final String continueAnswer = " <a href=" + mActivity.mWebViewClient.mBrowserBailOutToken + ">" + continueMsg + "</a><br>"; <END> assertEquals(continueAnswer, mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser()); nc.addTransportType(NetworkCapabilities.TRANSPORT_VPN); final String vpnWarning = mActivity.getString(R.string.ssl_error_vpnwarning); final String vpnAnswer = " <div class=vpnwarning>" + vpnWarning + "</div><br>"; assertEquals(vpnAnswer, mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser()); }</code><technical_language>This is a change-detector test ; break if change style spacing of specific HTML written. I opt for weaker coupling. For example, match "<a\s+href", if present a link, if present a link. check important thing, requiring exact indentation HTML, part of this test. avoid making mBrowserBailOutToken visible for testing</technical_language>

Target:
public void testVpnMsgOrLinkToBrowser() throws Exception { doReturn(mNetwork).when(sMockConnectivityManager).getActiveNetwork(); final NetworkCapabilities nonVpnCapabilities = new NetworkCapabilities(); doReturn(nonVpnCapabilities).when(sMockConnectivityManager).getNetworkCapabilities( mNetwork); final String continueMsg = mActivity.getString(R.string.ssl_error_continue); final String linkMatcher = ".*<a\\s+href.*"; assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(linkMatcher)); final NetworkCapabilities vpnCapabilities = new NetworkCapabilities(); vpnCapabilities.addTransportType(NetworkCapabilities.TRANSPORT_VPN); doReturn(vpnCapabilities).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); final String vpnWarning = mActivity.getString(R.string.ssl_error_vpnwarning); final String vpnMatcher = ".*<div.*vpnwarning.*"; assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(vpnMatcher)); }
Source:
<code>private void load() { if (loaded) { return; } System.out.println("--- loading sequence node " + getId() + " ---"); try (Transaction tx = service.beginTx()) { start = (int) node.getProperty(PropertyTypes.STARTREF.name()); end = (int) node.getProperty(PropertyTypes.ENDREF.name()); sequence = (String) node.getProperty(PropertyTypes.SEQUENCE.name()); rank = (int) node.getProperty(PropertyTypes.RANK.name()); <START> node.getRelationships(RelTypes.SOURCE).forEach(e -> { <END> sources.add((String) e.getEndNode().getProperty(PropertyTypes.SOURCE.name())); }); tx.success(); } loaded = true; }</code><technical_language>Redundant this in constructor</technical_language>

Target:
private void load() { if (loaded) { return; } System.out.println("--- loading sequence node " + getId() + " ---"); try (Transaction tx = service.beginTx()) { start = (int) node.getProperty(PropertyTypes.STARTREF.name()); end = (int) node.getProperty(PropertyTypes.ENDREF.name()); sequence = (String) node.getProperty(PropertyTypes.SEQUENCE.name()); rank = (int) node.getProperty(PropertyTypes.RANK.name()); tx.success(); } loaded = true; }
Source:
<code>SubscribedRepository(String name) { this.name = name; <START> subscribeSpecs = new HashMap<String, SubscribeSpec>(); <END> }</code><technical_language>a concurrentHasMap, remove synchronized public methods</technical_language>

Target:
private SubscribedRepository(String name) { this.name = name; subscribeSpecs = new HashSet<SubscribeSpec>(); }
Source:
<code>public EntityData.Event serialize(Event event) { EventMetadata<?> eventMetadata = eventLibrary.getMetadata(event.getClass()); if (eventMetadata == null) { throw new SerializationException("Unregistered event type: " + event.getClass()); } else if (!eventMetadata.isConstructable()) { throw new SerializationException("Cannot serialize event '" + eventMetadata + "' - lacks default constructor so cannot be deserialized"); } EntityData.Event.Builder eventData = EntityData.Event.newBuilder(); serializeEventType(event, eventData); Serializer eventSerializer = typeSerializationLibrary.getSerializerFor(eventMetadata); ByteString.Output fieldIds = ByteString.newOutput(); eventMetadata.getFields().stream().filter(field -> field.isReplicated()).forEach(field -> { EntityData.Value serializedValue = ((ProtobufPersistedData) eventSerializer.serialize(field, event, serializationContext)).getValue(); if (serializedValue != null) { eventData.addFieldValue(serializedValue); <START> fieldIds.write(field.getId()); <END> } }); eventData.setFieldIds(fieldIds.toByteString()); return eventData.build(); }</code><technical_language>This method is called often. original version, I faster Java8 method easier read</technical_language>

Target:
public EntityData.Event serialize(Event event) { EventMetadata<?> eventMetadata = eventLibrary.getMetadata(event.getClass()); if (eventMetadata == null) { throw new SerializationException("Unregistered event type: " + event.getClass()); } else if (!eventMetadata.isConstructable()) { throw new SerializationException("Cannot serialize event '" + eventMetadata + "' - lacks default constructor so cannot be deserialized"); } EntityData.Event.Builder eventData = EntityData.Event.newBuilder(); serializeEventType(event, eventData); Serializer eventSerializer = typeSerializationLibrary.getSerializerFor(eventMetadata); ByteString.Output fieldIds = ByteString.newOutput(); for (ReplicatedFieldMetadata field : eventMetadata.getFields()) { if (field.isReplicated()) { EntityData.Value serializedValue = ((ProtobufPersistedData) eventSerializer.serialize(field, event, serializationContext)).getValue(); if (serializedValue != null) { eventData.addFieldValue(serializedValue); fieldIds.write(field.getId()); } } } eventData.setFieldIds(fieldIds.toByteString()); return eventData.build(); }
Source:
<code>private void initializeTopoSharedOffHeapNodeMemoryFlag(TopologyDetails td) { String topoId = td.getId(); topoSharedOffHeapMemoryNodeFlag.put(topoId, false); StormTopology topology = td.getTopology(); if (topology == null) { return; } <START> if (topology.is_set_component_to_shared_memory()) { <END> for (Set<String> sharedNames : topology.get_component_to_shared_memory().values()) { if (sharedNames != null) { for (String name : sharedNames) { double val = topology.get_shared_memory().get(name).get_off_heap_node(); if (val > 0.0) { topoSharedOffHeapMemoryNodeFlag.put(topoId, true); return; } } } } } }</code><technical_language>able simplify this StormTopology topology = td.getTopology(); if (topology.is_set_shared_memory()) { for (SharedMemory sharedMemory : topology.get_shared_memory().values()) { double val = sharedMemory.get_off_heap_node(); if (val > 0.0) { topoSharedOffHeapMemoryNodeFlag.put(topoId, true); return; } } }</technical_language>

Target:
private void initializeTopoSharedOffHeapNodeMemoryFlag(TopologyDetails td) { String topoId = td.getId(); topoSharedOffHeapMemoryNodeFlag.put(topoId, false); StormTopology topology = td.getTopology(); if (topology == null) { return; } if (topology.is_set_shared_memory()) { for (SharedMemory sharedMemory : topology.get_shared_memory().values()) { double val = sharedMemory.get_off_heap_node(); if (val > 0.0) { topoSharedOffHeapMemoryNodeFlag.put(topoId, true); return; } } } }
Source:
<code>private void releaseFileChannel(long logId, CachedFileChannel cachedFileChannel) { lock.writeLock().lock(); try { if (cachedFileChannel.markDead()) { <START> try { <END> cachedFileChannel.fileChannel.close(); } catch (IOException e) { LOG.warn("Exception occurred in ReferenceCountedFileChannel" + " while closing channel for log file: {}", cachedFileChannel); } finally { IOUtils.close(LOG, cachedFileChannel.fileChannel); } fileChannels.remove(logId, cachedFileChannel); } } finally { lock.writeLock().unlock(); } }</code><technical_language>here, I closing a file channel a write lock. question is lock is locking</technical_language>

Target:
private void releaseFileChannel(long logId, CachedFileChannel cachedFileChannel) { if (cachedFileChannel.markDead()) { fileChannels.remove(logId, cachedFileChannel); try { cachedFileChannel.fileChannel.close(); } catch (IOException e) { LOG.warn("Exception occurred in ReferenceCountedFileChannel" + " while closing channel for log file: {}", cachedFileChannel); } finally { IOUtils.close(LOG, cachedFileChannel.fileChannel); } } }
Source:
<code>public <TElement extends Element> void updateElement(Graph graph, ExistingElementMutation<TElement> mutation, Authorizations authorizations) { TElement element = mutation.getElement(); if (MUTATION_LOGGER.isTraceEnabled()) { MUTATION_LOGGER.trace("updateElement: %s", element.getId()); } if (!getConfig().isIndexEdges() && element instanceof Edge) { return; } if (flushObjectQueue.containsElementId(element.getId())) { flushObjectQueue.flush(); } UpdateRequestBuilder updateRequestBuilder = prepareUpdateForMutation(graph, mutation); if (updateRequestBuilder != null) { IndexInfo indexInfo = addMutationPropertiesToIndex(graph, mutation); getIndexRefreshTracker().pushChange(indexInfo.getIndexName()); addActionRequestBuilderForFlush(element, updateRequestBuilder); <START> ImmutableSet<String> extendedDataTableNames = mutation.getElement().getExtendedDataTableNames(); <END> if (mutation.getNewElementVisibility() != null && extendedDataTableNames != null && !extendedDataTableNames.isEmpty() ) { extendedDataTableNames.forEach(tableName -> alterExtendedDataElementTypeVisibility( graph, element, element.getExtendedData(tableName), mutation.getOldElementVisibility(), mutation.getNewElementVisibility() )); } if (getConfig().isAutoFlush()) { flush(graph); } } }</code><technical_language>fetch hints include extended data table names</technical_language>

Target:
public <TElement extends Element> void updateElement(Graph graph, ExistingElementMutation<TElement> mutation, Authorizations authorizations) { TElement element = mutation.getElement(); if (MUTATION_LOGGER.isTraceEnabled()) { MUTATION_LOGGER.trace("updateElement: %s", element.getId()); } if (!getConfig().isIndexEdges() && element instanceof Edge) { return; } if (flushObjectQueue.containsElementId(element.getId())) { flushObjectQueue.flush(); } UpdateRequestBuilder updateRequestBuilder = prepareUpdateForMutation(graph, mutation); if (updateRequestBuilder != null) { IndexInfo indexInfo = addMutationPropertiesToIndex(graph, mutation); getIndexRefreshTracker().pushChange(indexInfo.getIndexName()); addActionRequestBuilderForFlush(element, updateRequestBuilder); if (mutation.getNewElementVisibility() != null && element.getFetchHints().isIncludeExtendedDataTableNames()) { ImmutableSet<String> extendedDataTableNames = element.getExtendedDataTableNames(); if (extendedDataTableNames != null && !extendedDataTableNames.isEmpty()) { extendedDataTableNames.forEach(tableName -> alterExtendedDataElementTypeVisibility( graph, element, element.getExtendedData(tableName), mutation.getOldElementVisibility(), mutation.getNewElementVisibility() )); } } if (getConfig().isAutoFlush()) { flush(graph); } } }
Source:
<code>public List<Phonenumber> getPhonenumbers() { if (isValidPatientId()) { return loadTestDataService.getAllPhonenumbersBy(getPatientId()); } else { return new ArrayList<>(); } <START> } <END></code><technical_language>A method return statement instead of two. a local variable get result return local variable</technical_language>

Target:
public List<Phonenumber> getPhonenumbers() { return loadTestDataService.getAllPhonenumbersBy(getPatientId()); }
Source:
<code>private boolean hasPermissionOnExternalPath( PathSupplier pathSupplier, String... actions ) throws RepositoryException { Connectors connectors = this.repository().runningState().connectors(); if (!connectors.hasConnectors() || !connectors.hasReadonlyConnectors()) { return true; } Path path = pathSupplier.getAbsolutePath(); <START> if (connectors.isReadonlyPath(path, this)) { <END> if (actions.length > ModeShapePermissions.READONLY_EXTERNAL_PATH_PERMISSIONS.size()) { return false; } List<String> actionsList = new ArrayList<String>(Arrays.asList(actions)); for (Iterator<String> actionsIterator = actionsList.iterator(); actionsIterator.hasNext();) { String action = actionsIterator.next(); if (!ModeShapePermissions.READONLY_EXTERNAL_PATH_PERMISSIONS.contains(action)) { return false; } actionsIterator.remove(); } return actionsList.isEmpty(); } return true; }</code><technical_language>if path is null call this (or handle exception)</technical_language>

Target:
private boolean hasPermissionOnExternalPath( PathSupplier pathSupplier, String... actions ) throws RepositoryException { Connectors connectors = this.repository().runningState().connectors(); if (!connectors.hasConnectors() || !connectors.hasReadonlyConnectors()) { return true; } Path path = pathSupplier.getAbsolutePath(); if (path == null) return false; if (connectors.isReadonlyPath(path, this)) { if (actions.length > ModeShapePermissions.READONLY_EXTERNAL_PATH_PERMISSIONS.size()) { return false; } List<String> actionsList = new ArrayList<String>(Arrays.asList(actions)); for (Iterator<String> actionsIterator = actionsList.iterator(); actionsIterator.hasNext();) { String action = actionsIterator.next(); if (!ModeShapePermissions.READONLY_EXTERNAL_PATH_PERMISSIONS.contains(action)) { return false; } actionsIterator.remove(); } return actionsList.isEmpty(); } return true; }
Source:
<code>public TextAnalyticsClientBuilder endpoint(String endpoint) { try { new URL(endpoint); } catch (MalformedURLException ex) { <START> throw logger.logExceptionAsWarning(new IllegalArgumentException("'endpoint' must be a valid URL")); <END> } this.endpoint = endpoint; return this; }</code><technical_language>ex throwable illegal argument exception, consumers understand parse failed</technical_language>

Target:
public TextAnalyticsClientBuilder endpoint(String endpoint) { Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); try { new URL(endpoint); } catch (MalformedURLException ex) { throw logger.logExceptionAsWarning(new IllegalArgumentException("'endpoint' must be a valid URL", ex)); } this.endpoint = endpoint; return this; }
Source:
<code>public void testJenkinsNodeMetrics() throws Exception { DatadogClientStub client = new DatadogClientStub(); DatadogComputerPublisherTestWrapper computerPublisher = new DatadogComputerPublisherTestWrapper(); <START> ((DatadogComputerPublisherTestWrapper)computerPublisher).setDatadogClient(client); <END> String url = jenkins.getURL().toString(); String hostname = DatadogUtilities.getHostname(null); String nodeHostname = null; for (Computer computer: jenkins.jenkins.getComputers()){ nodeHostname = computer.getHostName(); } String[] expectedTags = new String[3]; expectedTags[0] = "node_name:master"; expectedTags[1] = "node_label:master"; expectedTags[2] = "jenkins_url:" + url; if (nodeHostname != null) { expectedTags = Arrays.copyOf(expectedTags, 4); expectedTags[3] = "node_hostname:" + nodeHostname; } computerPublisher.doRun(); client.assertMetric("jenkins.node_status.count", 1, hostname, expectedTags); client.assertMetric("jenkins.node_status.offline", 0, hostname, expectedTags); client.assertMetric("jenkins.node_status.online", 1, hostname, expectedTags); for (Computer computer: jenkins.jenkins.getComputers()){ computer.setTemporarilyOffline(true, OfflineCause.create(Messages._Hudson_Computer_DisplayName())); } computerPublisher.doRun(); client.assertMetric("jenkins.node_status.count", 1, hostname, expectedTags); client.assertMetric("jenkins.node_status.offline", 1, hostname, expectedTags); client.assertMetric("jenkins.node_status.online", 0, hostname, expectedTags); }</code><technical_language>suggestion computerPublisher.setDatadogClient(client);</technical_language>

Target:
public void testJenkinsNodeMetrics() throws Exception { DatadogComputerPublisher computerPublisher = new DatadogComputerPublisher(); String url = jenkins.getURL().toString(); String hostname = DatadogUtilities.getHostname(null); String[] expectedTags = new String[3]; expectedTags[0] = "node_name:master"; expectedTags[1] = "node_label:master"; expectedTags[2] = "jenkins_url:" + url; String nodeHostname = jenkins.jenkins.getComputer("").getHostName(); if (nodeHostname != null) { expectedTags = Arrays.copyOf(expectedTags, 4); expectedTags[3] = "node_hostname:" + nodeHostname; } computerPublisher.doRun(); client.assertMetric("jenkins.node_status.count", 1, hostname, expectedTags); client.assertMetric("jenkins.node_status.up", 1, hostname, expectedTags); for (Computer computer: jenkins.jenkins.getComputers()){ computer.setTemporarilyOffline(true, OfflineCause.create(Messages._Hudson_Computer_DisplayName())); } computerPublisher.doRun(); client.assertMetric("jenkins.node_status.count", 1, hostname, expectedTags); client.assertMetric("jenkins.node_status.up", 0, hostname, expectedTags); }
Source:
<code>private void updateConfiguration(final Map<String, Object> configuration) throws ConfigurationException { Set<String> keys = configuration.keySet(); Iterator<String> keysIt = keys.iterator(); while (keysIt.hasNext()) { String key = (String) keysIt.next(); Matcher matcher = EXTRACT_HORIZON_CONFIG_PATTERN.matcher(key); if (!matcher.matches()) { logger.debug("given config key '" + key + "' does not follow the expected pattern '<id>.<host>'"); continue; <START> } <END> matcher.reset(); matcher.find(); String deviceId = matcher.group(1); String host = null; String configKey = matcher.group(2); String value = (String) configuration.get(key); if ("host".equals(configKey)) { host = value; } else { throw new ConfigurationException("The given configKey '" + configKey + "' is unknown"); } HorizonBox horizonBox = new HorizonBox(host, DEFAULT_HORIZON_PORT); deviceConfigCache.put(deviceId, horizonBox); } }</code><technical_language>skipping service.pid key in configuration</technical_language>

Target:
private void updateConfiguration(final Map<String, Object> configuration) throws ConfigurationException { Set<String> keys = configuration.keySet(); Iterator<String> keysIt = keys.iterator(); while (keysIt.hasNext()) { String key = keysIt.next(); if ("service.pid".equals(key)) { continue; } Matcher matcher = EXTRACT_HORIZON_CONFIG_PATTERN.matcher(key); if (!matcher.matches()) { logger.debug("given config key '" + key + "' does not follow the expected pattern '<id>.<host>'"); continue; } matcher.reset(); matcher.find(); String deviceId = matcher.group(1); String host = null; String configKey = matcher.group(2); String value = (String) configuration.get(key); if ("host".equals(configKey)) { host = value; } else { throw new ConfigurationException("The given configKey '" + configKey + "' is unknown"); } HorizonBox horizonBox = new HorizonBox(host, DEFAULT_HORIZON_PORT); deviceConfigCache.put(deviceId, horizonBox); } }
Source:
<code>public Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); final Map parameters = event.getParameters(); final Object value = parameters.get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_ID); final String newWindow = (String) parameters .get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_NEWWINDOW); if (value == null) { openOther(window); } else { Object[] <START> found = <END> new Object[1]; BusyIndicator.showWhile(null, () -> { try { if (newWindow == null || newWindow.equalsIgnoreCase("false")) { openPerspective((String) value, window); } else { openNewWindowPerspective((String) value, window); } } catch (ExecutionException e) { found[0] = e; } }); if (found[0] instanceof ExecutionException) { throw ((ExecutionException) found[0]); } } return null; }</code><technical_language>This a good name</technical_language>

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); final Map parameters = event.getParameters(); final Object value = parameters.get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_ID); final String newWindow = (String) parameters .get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_NEWWINDOW); if (value == null) { openOther(window); } else { ExecutionException[] exception = new ExecutionException[1]; BusyIndicator.showWhile(null, () -> { try { if (newWindow == null || newWindow.equalsIgnoreCase("false")) { openPerspective((String) value, window); } else { openNewWindowPerspective((String) value, window); } } catch (ExecutionException e) { exception[0] = e; } }); if (exception[0] != null) { throw exception[0]; } } return null; }
Source:
<code>void addPrefix(String prefix) { assert !prefix.isEmpty(); terminal = false; char ch = prefix.charAt(0); <START> if (!children.containsKey(ch)) { <END> children.put(ch, new Node()); } if (prefix.length() > 1) { children.get(ch).addPrefix(prefix.substring(1)); } }</code><technical_language>putIfAbsent here</technical_language>

Target:
void addPrefix(String prefix) { terminal = false; char ch = prefix.charAt(0); children.putIfAbsent(ch, new Node()); if (prefix.length() > 1) { children.get(ch).addPrefix(prefix.substring(1)); } }
Source:
<code>private static boolean isException(FunctionDef suspiciousMethod) { boolean hasDocString = suspiciousMethod.docstring() != null; StatementList suspiciousBody = suspiciousMethod.body(); int nbActualStatements = hasDocString ? suspiciousBody.statements().size() - 1 : suspiciousBody.statements().size(); if (nbActualStatements == 0 || isOnASingleLine(suspiciousBody, hasDocString)) { return true; } <START> return nbActualStatements == 1 && suspiciousBody.statements().get(suspiciousBody.statements().size() - 1).is(Tree.Kind.RAISE_STMT); <END> }</code><technical_language>create a variable for suspiciousBody.statements() instead of duplicating expression 4 times</technical_language>

Target:
private static boolean isException(FunctionDef suspiciousMethod) { boolean hasDocString = suspiciousMethod.docstring() != null; StatementList suspiciousBody = suspiciousMethod.body(); List<Statement> statements = suspiciousBody.statements(); int nbActualStatements = hasDocString ? statements.size() - 1 : statements.size(); if (nbActualStatements == 0 || isOnASingleLine(suspiciousBody, hasDocString)) { return true; } return nbActualStatements == 1 && statements.get(statements.size() - 1).is(Tree.Kind.RAISE_STMT); }
Source:
<code>private void flattenTuple(CComplexObject newObject, CAttributeTuple tuple) { CAttributeTuple matchingTuple = findMatchingTuple(newObject.getAttributeTuples(), tuple); CAttributeTuple tupleClone = (CAttributeTuple) tuple.clone(); if(matchingTuple == null) { newObject.addAttributeTuple(tupleClone); } else { newObject.getAttributeTuples().remove(matchingTuple); <START> newObject.addAttributeTuple(tupleClone); <END> } for(CAttribute attribute:tupleClone.getMembers()){ newObject.replaceAttribute(attribute); } }</code><technical_language>order matter in tuples added? ie. tupleClone need added place matchingTuple was</technical_language>

Target:
private void flattenTuple(CComplexObject newObject, CAttributeTuple tuple) { CAttributeTuple matchingTuple = findMatchingTuple(newObject.getAttributeTuples(), tuple); CAttributeTuple tupleClone = (CAttributeTuple) tuple.clone(); if(matchingTuple == null) { newObject.addAttributeTuple(tupleClone); } else { newObject.getAttributeTuples().remove(matchingTuple); newObject.addAttributeTuple(tupleClone); } for(CAttribute attribute:tupleClone.getMembers()){ newObject.replaceAttribute(attribute); } for(CPrimitiveTuple primitiveTuple:tupleClone.getTuples()) { int i = 0; for(CPrimitiveObject object:primitiveTuple.getMembers()) { object.setSocParent(primitiveTuple); object.setParent((tupleClone.getMembers().get(i))); i++; } } }
Source:
<code>public SafetyCommand() { <START> super(); <END> }</code><technical_language>this("Safety Command")</technical_language>

Target:
public SafetyCommand() { this("SafetyCommand"); }
Source:
<code><START> public static void addSingletonToCount(final LibraryIdGenerator libraryIdGenerator){ <END> addSingletonToCount(libraryIdGenerator.getDuplicateCountHist(), libraryIdGenerator.getNonOpticalDuplicateCountHist()); }</code><technical_language>missing space ){</technical_language>

Target:
public static void addSingletonToCount(final LibraryIdGenerator libraryIdGenerator) { libraryIdGenerator.getDuplicateCountHist().increment(1.0); libraryIdGenerator.getNonOpticalDuplicateCountHist().increment(1.0); }
Source:
<code>public void testConstantQuery() throws Exception { runQueryAndWaitForEvents("SELECT 1", 3); QueryCreatedEvent queryCreatedEvent = getOnlyElement(generatedEvents.getQueryCreatedEvents()); assertEquals(queryCreatedEvent.getContext().getServerVersion(), "testversion"); assertEquals(queryCreatedEvent.getContext().getServerAddress(), "127.0.0.1"); assertEquals(queryCreatedEvent.getContext().getEnvironment(), "testing"); assertEquals(queryCreatedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQuery(), "SELECT 1"); QueryCompletedEvent queryCompletedEvent = getOnlyElement(generatedEvents.getQueryCompletedEvents()); assertTrue(queryCompletedEvent.getContext().getResourceGroupName().isPresent()); <START> assertEquals(queryCompletedEvent.getContext().getResourceGroupName().get(), "global.event-client-test"); <END> assertEquals(queryCompletedEvent.getStatistics().getTotalRows(), 0L); assertEquals(queryCompletedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); List<SplitCompletedEvent> splitCompletedEvents = generatedEvents.getSplitCompletedEvents(); assertEquals(splitCompletedEvents.get(0).getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); assertEquals(splitCompletedEvents.get(0).getStatistics().getCompletedPositions(), 1); }</code><technical_language>this user group</technical_language>

Target:
public void testConstantQuery() throws Exception { runQueryAndWaitForEvents("SELECT 1", 3); QueryCreatedEvent queryCreatedEvent = getOnlyElement(generatedEvents.getQueryCreatedEvents()); assertEquals(queryCreatedEvent.getContext().getServerVersion(), "testversion"); assertEquals(queryCreatedEvent.getContext().getServerAddress(), "127.0.0.1"); assertEquals(queryCreatedEvent.getContext().getEnvironment(), "testing"); assertEquals(queryCreatedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQuery(), "SELECT 1"); QueryCompletedEvent queryCompletedEvent = getOnlyElement(generatedEvents.getQueryCompletedEvents()); assertTrue(queryCompletedEvent.getContext().getResourceGroupName().isPresent()); assertEquals(queryCompletedEvent.getContext().getResourceGroupName().get(), "global.user-user"); assertEquals(queryCompletedEvent.getStatistics().getTotalRows(), 0L); assertEquals(queryCompletedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); List<SplitCompletedEvent> splitCompletedEvents = generatedEvents.getSplitCompletedEvents(); assertEquals(splitCompletedEvents.get(0).getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); assertEquals(splitCompletedEvents.get(0).getStatistics().getCompletedPositions(), 1); }
Source:
<code><START> public KafkaPositionTracker(@NotNull final String datastreamTaskPrefix, @NotNull final String datastreamTaskName, <END> @NotNull final Instant connectorTaskStartTime, final boolean enableBrokerOffsetFetcher, @NotNull final Supplier<Boolean> isConnectorTaskAlive, @NotNull final Supplier<Consumer<?, ?>> consumerSupplier) { _datastreamTaskPrefix = datastreamTaskPrefix; _datastreamTaskName = datastreamTaskName; _connectorTaskStartTime = connectorTaskStartTime; _consumerSupplier = consumerSupplier; if (enableBrokerOffsetFetcher) { _brokerOffsetFetcher = new BrokerOffsetFetcher(datastreamTaskName, this, isConnectorTaskAlive); _brokerOffsetFetcher.startAsync(); } else { _brokerOffsetFetcher = null; } }</code><technical_language>want consider introducing a config object for ctor params -</technical_language>

Target:
private KafkaPositionTracker(@NotNull final String datastreamTaskPrefix, @NotNull final String datastreamTaskName, @NotNull final Instant connectorTaskStartTime, final boolean enableBrokerOffsetFetcher, @NotNull final Supplier<Boolean> isConnectorTaskAlive, @NotNull final Supplier<Consumer<?, ?>> consumerSupplier) { _datastreamTaskPrefix = datastreamTaskPrefix; _datastreamTaskName = datastreamTaskName; _connectorTaskStartTime = connectorTaskStartTime; _consumerSupplier = consumerSupplier; if (enableBrokerOffsetFetcher) { _brokerOffsetFetcher = new BrokerOffsetFetcher(datastreamTaskName, this, isConnectorTaskAlive); _brokerOffsetFetcher.startAsync(); } else { _brokerOffsetFetcher = null; } }
Source:
<code>protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { changeDiagramUIPreference(SiriusDiagramUiPreferencesKeys.PREF_OLD_UI.name(), false); sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); <START> <END> localSession.changeViewpointSelection(Sets.newHashSet("Design"), Sets.<String> newHashSet()); diagram = localSession.getLocalSessionBrowser().perCategory().selectViewpoint("Design").selectRepresentation("Entities").selectDiagramInstance("aaaa package entities").open(); editor = diagram.getEditor(); }</code><technical_language>session is fully initialized? This is time consumer useful for this test</technical_language>

Target:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); diagram = localSession.getLocalSessionBrowser().perCategory().selectViewpoint("Design").selectRepresentation("Entities").selectDiagramInstance("aaaa package entities").open(); editor = diagram.getEditor(); }
Source:
<code>private static OkHttpClient createClient() { OkHttpClient.Builder builder = new OkHttpClient.Builder() .cookieJar(SharedPreferenceCookieManager.getInstance()) .cache(NET_CACHE) .addInterceptor(getLoggingInterceptor()) .addInterceptor(new UnsuccessfulResponseInterceptor()) .addInterceptor(new CommonHeaderRequestInterceptor()); <START> if(BuildConfig.FLAVOR.equals("beta")){ <END> builder.sslSocketFactory(SslUtils.INSTANCE.getSslContextForCertificateFile(CommonsApplication.getInstance(), "*.wikimedia.beta.wmflabs.org.cer").getSocketFactory()); } return builder.build(); }</code><technical_language>ConfigUtils:isBetaFlavour</technical_language>

Target:
private static OkHttpClient createClient() { OkHttpClient.Builder builder = new OkHttpClient.Builder() .cookieJar(SharedPreferenceCookieManager.getInstance()) .cache(NET_CACHE) .addInterceptor(getLoggingInterceptor()) .addInterceptor(new UnsuccessfulResponseInterceptor()) .addInterceptor(new CommonHeaderRequestInterceptor()); if(ConfigUtils.isBetaFlavour()){ builder.sslSocketFactory(SslUtils.INSTANCE.getSslContextForCertificateFile(CommonsApplication.getInstance(), "*.wikimedia.beta.wmflabs.org.cer").getSocketFactory()); } return builder.build(); }
Source:
<code>public Dialog onCreateDialog(Bundle bundle) { final View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_restricted_login_dialog, null); TextView text = (TextView) rootView.findViewById(R.id.dialog_restricted_login_text); String link = Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()) ? getString(R.string.schoolreg_link_german) : getString(R.string.schoolreg_link); text.setText(text.getText().toString().replace("%1$s", link)); Linkify.addLinks(text, Linkify.WEB_URLS); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity()) .setView(rootView) .setTitle(R.string.dialog_restricted_login_title) .setPositiveButton(R.string.ok, null); restrictedLoginDialog = dialogBuilder.create(); restrictedLoginDialog.setCanceledOnTouchOutside(false); restrictedLoginDialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Button okButton = restrictedLoginDialog.getButton(AlertDialog.BUTTON_POSITIVE); okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { PreferenceManager.getDefaultSharedPreferences(getActivity()).edit() .putBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, true) .apply(); if (!Utils.isUserLoggedIn(getActivity()) || !Utils.isCreateAtSchoolUser(getActivity())) { <START> Utils.showPrivacyPolicyDialogWithLoginDialogAction(getActivity()); <END> } dismiss(); } }); TextSizeUtil.enlargeViewGroup((ViewGroup) rootView.getRootView()); } }); return restrictedLoginDialog; }</code><technical_language>is this shown user accepted privacy policy</technical_language>

Target:
public Dialog onCreateDialog(Bundle bundle) { final View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_restricted_login_dialog, null); TextView text = (TextView) rootView.findViewById(R.id.dialog_restricted_login_text); String link = Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()) ? getString(R.string.schoolreg_link_german) : getString(R.string.schoolreg_link); text.setText(text.getText().toString().replace("%1$s", link)); Linkify.addLinks(text, Linkify.WEB_URLS); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity()) .setView(rootView) .setTitle(R.string.dialog_restricted_login_title) .setPositiveButton(R.string.ok, null); restrictedLoginDialog = dialogBuilder.create(); restrictedLoginDialog.setCanceledOnTouchOutside(false); restrictedLoginDialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Button okButton = restrictedLoginDialog.getButton(AlertDialog.BUTTON_POSITIVE); okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { PreferenceManager.getDefaultSharedPreferences(getActivity()).edit() .putBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, true) .apply(); if (!Utils.isUserLoggedIn(getActivity()) || !Utils.isCreateAtSchoolUser(getActivity())) { Utils.showPrivacyPolicyOrLoginDialog(getActivity()); } dismiss(); } }); TextSizeUtil.enlargeViewGroup((ViewGroup) rootView.getRootView()); } }); return restrictedLoginDialog; }
Source:
<code>public boolean match(ChangeData object) throws OrmException { try { <START> return object.commitMessage(repoManager, db).contains(value); <END> } catch (IOException e) { return false; } }</code><technical_language>This a match strategy</technical_language>

Target:
public boolean match(ChangeData object) throws OrmException { try { for (ChangeData cData : index .getSource(new MessagePredicate(db, repoManager, index, value)) .read()) { if (cData.getId().equals(object.getId())) { return true; } } } catch (QueryParseException e) { throw new OrmException(e); } return false; }
Source:
<code>public List<ExtensionDefinition> getAllExtensionDefinitions() { List<Extension> extensions = fromEntity(dao.getAllExtensions()); <START> final List<ExtensionDefinition> extensionMaps = new ArrayList<>(); <END> for (Extension extension : extensions) { final ExtensionDefinition extensionMap = new ExtensionDefinition(extension.getUrn()); for (Entry<String, Field> fieldEntry : extension.getFields().entrySet()) { final String field = fieldEntry.getKey(); final ExtensionFieldType<?> type = fieldEntry.getValue().getType(); extensionMap.addPair(field, type); } extensionMaps.add(extensionMap); } return extensionMaps; }</code><technical_language>extensionDefinitions</technical_language>

Target:
public List<ExtensionDefinition> getAllExtensionDefinitions() { List<Extension> extensions = fromEntity(dao.getAllExtensions()); final List<ExtensionDefinition> extensionDefinitions = new ArrayList<>(); for (Extension extension : extensions) { final ExtensionDefinition extensionDefinition = new ExtensionDefinition(extension.getUrn()); for (Entry<String, Field> fieldEntry : extension.getFields().entrySet()) { final String field = fieldEntry.getKey(); final ExtensionFieldType<?> type = fieldEntry.getValue().getType(); extensionDefinition.addPair(field, type); } extensionDefinitions.add(extensionDefinition); } return extensionDefinitions; }
Source:
<code>public void register() { Chart chart = getChart(); <START> chart.getPlotArea().addMouseTrackListener(this); <END> chart.getPlotArea().addMouseMoveListener(this); chart.getPlotArea().addPaintListener(this); fTooltipHandler.activateHoverHelp(chart.getPlotArea()); }</code><technical_language>remove</technical_language>

Target:
public void register() { Chart chart = getChart(); chart.getPlotArea().addMouseMoveListener(this); chart.getPlotArea().addPaintListener(this); fTooltipHandler.activateHoverHelp(chart.getPlotArea()); }