auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DataSchema( @JsonProperty("dataSource") String dataSource, @JsonProperty("parser") Map<String, Object> parser, @JsonProperty("metricsSpec") AggregatorFactory[] aggregators, @JsonProperty("granularitySpec") GranularitySpec granularitySpec, @JacksonInject ObjectMapper jsonMapper ) { this.jsonMapper = Preconditions.checkNotNull(jsonMapper, "null ObjectMapper."); this.dataSource = Preconditions.checkNotNull(dataSource, "dataSource cannot be null. Please provide a dataSource."); this.parser = parser; this.aggregators = Preconditions.checkNotNull( aggregators, "metricsSpec cannot be null. Please provide metricsSpec" ); if (aggregators.length == 0) { log.warn("No metricsSpec has been specified. Are you sure this is what you want?"); } if (granularitySpec == null) { log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default."); this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec; } }

Target:
public DataSchema( @JsonProperty("dataSource") String dataSource, @JsonProperty("parser") Map<String, Object> parser, @JsonProperty("metricsSpec") AggregatorFactory[] aggregators, @JsonProperty("granularitySpec") GranularitySpec granularitySpec, @JacksonInject ObjectMapper jsonMapper ) { this.dataSource = Preconditions.checkNotNull(dataSource, "dataSource cannot be null. Please provide a dataSource."); this.jsonMapper = jsonMapper; this.parser = parser; this.aggregators = aggregators == null ? new AggregatorFactory[]{} : aggregators; if (this.aggregators.length == 0) { log.warn("No metricsSpec has been specified. Are you sure this is what you want?"); } if (granularitySpec == null) { log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default."); this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec; } }
Source:
public String getServiceToken(String url, String service) { String token; try (CloseableHttpClient httpClient = new CommonHttpClientBuilder().allowAnyCertificate(true).build()) { HttpPost httpPost = new HttpPost(url); List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair(SERVICE_KEY, service)); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); if ((httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) || (null == httpResponse.getEntity())) throw new IAMException("Failed to acquire token for the service " + service, new HTTPException(httpResponse.getStatusLine().getStatusCode())); token = EntityUtils.toString(httpResponse.getEntity()); LOG.debug("Service token successfully generated for service " + service + "\n Token: " + token); } catch (Exception e) { throw new IAMException("Error occurred while acquiring authentication token for the service " + service, e); } return token; }

Target:
public String getServiceToken(String url, String service) { String token; try (CloseableHttpClient httpClient = new CommonHttpClientBuilder().allowAnyCertificate(true).build()) { HttpPost httpPost = new HttpPost(url); List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair(SERVICE_KEY, service)); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); if ((httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) || (null == httpResponse.getEntity())) { throw new IAMException("Failed to acquire token for the service " + service, new HTTPException(httpResponse.getStatusLine().getStatusCode())); } token = EntityUtils.toString(httpResponse.getEntity()); LOG.debug("Service token successfully generated for service " + service + "\n Token: " + token); } catch (Exception e) { throw new IAMException("Error occurred while acquiring authentication token for the service " + service, e); } return token; }
Source:
public OnSubscribeToMap(Observable<T> source, Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) { this(source, keySelector, valueSelector, DefaultMapFactory.<K, V>instance()); }

Target:
public OnSubscribeToMap(Observable<T> source, Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) { this(source, keySelector, valueSelector, null); }
Source:
private void readProperties() { attempts = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_RETRY_ATTEMPTS, "5")); timeout = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_RETRY_TIMEOUT, "2000")); cqlPort = AlertProperties.getProperty(ALERTS_CASSANDRA_PORT, ALERTS_CASSANDRA_PORT_ENV, "9042"); nodes = AlertProperties.getProperty(ALERTS_CASSANDRA_NODES, ALERTS_CASSANDRA_NODES_ENV, "127.0.0.1"); connTimeout = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_CONNECT_TIMEOUT, ALERTS_CASSANDRA_CONNECT_TIMEOUT_ENV, String.valueOf(SocketOptions.DEFAULT_CONNECT_TIMEOUT_MILLIS))); readTimeout = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_READ_TIMEOUT, ALERTS_CASSANDRA_READ_TIMEOUT_ENV, String.valueOf(SocketOptions.DEFAULT_READ_TIMEOUT_MILLIS))); overwrite = Boolean.parseBoolean(AlertProperties.getProperty(ALERTS_CASSANDRA_OVERWRITE, ALERTS_CASSANDRA_OVERWRITE_ENV, "false")); keyspace = AlertProperties.getProperty(ALERTS_CASSANDRA_KEYSPACE, "hawkular_alerts"); cassandraUseSSL = Boolean.parseBoolean(AlertProperties.getProperty(ALERTS_CASSANDRA_USESSL, ALERTS_CASSANDRA_USESSL_ENV, "false")); maxQueue = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_MAX_QUEUE, ALERTS_CASSANDRA_MAX_QUEUE_ENV, "9182")); }

Target:
private void readProperties() { attempts = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_RETRY_ATTEMPTS, ALERTS_CASSANDRA_RETRY_ATTEMPTS_DEFAULT)); timeout = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_RETRY_TIMEOUT, ALERTS_CASSANDRA_RETRY_TIMEOUT_DEFAULT)); cqlPort = AlertProperties.getProperty(ALERTS_CASSANDRA_PORT, ALERTS_CASSANDRA_PORT_ENV, ALERTS_CASSANDRA_PORT_ENV_DEFAULT); nodes = AlertProperties.getProperty(ALERTS_CASSANDRA_NODES, ALERTS_CASSANDRA_NODES_ENV, ALERTS_CASSANDRA_NODES_ENV_DEFAULT); connTimeout = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_CONNECT_TIMEOUT, ALERTS_CASSANDRA_CONNECT_TIMEOUT_ENV, String.valueOf(SocketOptions.DEFAULT_CONNECT_TIMEOUT_MILLIS))); readTimeout = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_READ_TIMEOUT, ALERTS_CASSANDRA_READ_TIMEOUT_ENV, String.valueOf(SocketOptions.DEFAULT_READ_TIMEOUT_MILLIS))); overwrite = Boolean.parseBoolean(AlertProperties.getProperty(ALERTS_CASSANDRA_OVERWRITE, ALERTS_CASSANDRA_OVERWRITE_ENV, ALERTS_CASSANDRA_OVERWRITE_ENV_DEFAULT)); keyspace = AlertProperties.getProperty(ALERTS_CASSANDRA_KEYSPACE, ALERTS_CASSANDRA_KEYSPACE_DEFAULT); cassandraUseSSL = Boolean.parseBoolean(AlertProperties.getProperty(ALERTS_CASSANDRA_USESSL, ALERTS_CASSANDRA_USESSL_ENV, ALERTS_CASSANDRA_USESSL_ENV_DEFAULT)); maxQueue = Integer.parseInt(AlertProperties.getProperty(ALERTS_CASSANDRA_MAX_QUEUE, ALERTS_CASSANDRA_MAX_QUEUE_ENV, ALERTS_CASSANDRA_MAX_QUEUE_ENV_DEFAULT)); }
Source:
public static void validateSlaParams(String entityType, String entityName, String start, String end, String colo) throws FalconException { EntityType type = EntityType.getEnum(entityType); LOG.info("EntityName:" + entityName); if (!Arrays.asList(EntityType.FEED.toString().toLowerCase(), EntityType.PROCESS.toString().toLowerCase()). contains(entityType.toLowerCase())){ throw new ValidationException("SLA monitoring is not supported for: " + type); } if (StringUtils.isNotBlank(entityName)) { EntityUtil.getEntity(entityType, entityName); } Date startTime, endTime; if (StringUtils.isBlank(start)) { throw new ValidationException("'start' is mandatory and can not be blank."); } else { startTime = SchemaHelper.parseDateUTC(start); } if (StringUtils.isBlank(end)) { endTime = new Date(); } else { endTime = SchemaHelper.parseDateUTC(end); } if (startTime.after(endTime)) { throw new ValidationException("start can not be after end"); } checkColo(colo); }

Target:
public static void validateSlaParams(String entityType, String entityName, String start, String end, String colo) throws FalconException { EntityType type = EntityType.getEnum(entityType); if (!type.isSchedulable()){ throw new ValidationException("SLA monitoring is not supported for: " + type); } if (StringUtils.isNotBlank(entityName)) { EntityUtil.getEntity(entityType, entityName); } Date startTime, endTime; if (StringUtils.isBlank(start)) { throw new ValidationException("'start' is mandatory and can not be blank."); } else { startTime = SchemaHelper.parseDateUTC(start); } if (StringUtils.isBlank(end)) { endTime = new Date(); } else { endTime = SchemaHelper.parseDateUTC(end); } if (startTime.after(endTime)) { throw new ValidationException("start can not be after end"); } checkColo(colo); }
Source:
static public junit.framework.Test suite() { VoltServerConfig config; MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder( TestCalciteAdHocPlannerCache.class); VoltProjectBuilder project = new VoltProjectBuilder(); final String literalSchema = "CREATE TABLE R1 ( " + " ID BIGINT DEFAULT 0 NOT NULL, " + "DESC VARCHAR(300), " + "NUM bigint," + "RATIO FLOAT, " + "PRIMARY KEY (desc)); "; try { project.addLiteralSchema(literalSchema); } catch (IOException e) { assertFalse(true); } boolean success; config = new LocalCluster("plansgroupby-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI); success = config.compile(project); assertTrue(success); builder.addServerConfig(config); return builder; }

Target:
static public junit.framework.Test suite() throws IOException { VoltServerConfig config; MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder( TestCalciteAdHocPlannerCache.class); VoltProjectBuilder project = new VoltProjectBuilder(); final String literalSchema = "CREATE TABLE R1 ( " + " ID BIGINT DEFAULT 0 NOT NULL, " + "DESC VARCHAR(300), " + "NUM bigint," + "RATIO FLOAT, " + "PRIMARY KEY (desc)); "; project.addLiteralSchema(literalSchema); boolean success; config = new LocalCluster("plansgroupby-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI); success = config.compile(project); assertTrue(success); builder.addServerConfig(config); return builder; }
Source:
public RelationshipValidator( String sourceAttribute, String sourceValue, String relationship, String targetAttribute, String... targetValues) { relationships.put("mustHave", this::mustHave); relationships.put("cannotHave", this::cannotHave); relationships.put("canOnlyHave", this::canOnlyHave); if (!relationships.keySet().contains(relationship)) { throw new IllegalArgumentException( "Unrecognized relationship " + relationship + "for validator " + this.toString()); } this.sourceAttribute = sourceAttribute; this.sourceValue = sourceValue; this.relationship = relationship; this.targetAttribute = targetAttribute; if (targetValues != null) { this.targetValues = Arrays.asList(targetValues); } else { this.targetValues = Collections.emptyList(); } }

Target:
public RelationshipValidator( String sourceAttribute, String sourceValue, String relationship, String targetAttribute, String... targetValues) { relationships.put(MUST_HAVE, this::mustHave); relationships.put(CANNOT_HAVE, this::cannotHave); relationships.put(CAN_ONLY_HAVE, this::canOnlyHave); this.sourceAttribute = sourceAttribute; this.sourceValue = sourceValue; this.relationship = relationship; this.targetAttribute = targetAttribute; if (targetValues != null) { this.targetValues = Arrays.stream(targetValues) .filter(Objects::nonNull) .map(Objects::toString) .collect(Collectors.toList()); } else { this.targetValues = Collections.emptyList(); } if (!relationships.keySet().contains(relationship)) { throw new IllegalArgumentException( "Unrecognized relationship " + relationship + " for validator " + this.toString()); } if (CAN_ONLY_HAVE.equals(relationship) && CollectionUtils.isEmpty(this.targetValues)) { throw new IllegalArgumentException( "Relationship " + CAN_ONLY_HAVE + " must specify one or more target values"); } }
Source:
public void testCreateAccountWithoutAgreeingToTermsOfService() throws Exception { String alias = "invalid"; addKeyStore(ACCOUNTS_KEYSTORE_NAME); addCertificateAuthorityWithoutStagingUrl(); addCertificateAuthorityAccountWithCustomCA(alias); server = setupTestCreateAccountWithoutAgreeingToTermsOfService(); AcmeAccount acmeAccount = getAcmeAccount(); try { assertNull(acmeAccount.getAccountUrl()); ModelNode operation = new ModelNode(); operation.get(ClientConstants.OP_ADDR).add("subsystem", "elytron").add("certificate-authority-account", CERTIFICATE_AUTHORITY_ACCOUNT_NAME); operation.get(ClientConstants.OP).set(ElytronDescriptionConstants.CREATE_ACCOUNT); operation.get(ElytronDescriptionConstants.AGREE_TO_TERMS_OF_SERVICE).set(false); String result = services.executeOperation(operation).get(FAILURE_DESCRIPTION).asString(); assertTrue(result.contains("WFLYELY01043") && result.contains("must agree to terms of service")); } finally { removeCertificateAuthorityAccount(); removeCertificateAuthority(); removeKeyStore(ACCOUNTS_KEYSTORE_NAME); } }

Target:
public void testCreateAccountWithoutAgreeingToTermsOfService() throws Exception { String alias = "invalid"; addKeyStore(ACCOUNTS_KEYSTORE_NAME); addCertificateAuthorityWithoutStagingUrl(); addCertificateAuthorityAccountWithCustomCA(alias); server = setupTestCreateAccountWithoutAgreeingToTermsOfService(); AcmeAccount acmeAccount = getAcmeAccount(); try { assertNull(acmeAccount.getAccountUrl()); ModelNode operation = new ModelNode(); operation.get(ClientConstants.OP_ADDR).add("subsystem", "elytron").add("certificate-authority-account", CERTIFICATE_AUTHORITY_ACCOUNT_NAME); operation.get(ClientConstants.OP).set(ElytronDescriptionConstants.CREATE_ACCOUNT); operation.get(ElytronDescriptionConstants.AGREE_TO_TERMS_OF_SERVICE).set(false); ModelNode result = services.executeOperation(operation); assertFailed(result); String failureDescription = result.get(FAILURE_DESCRIPTION).asString(); assertTrue(failureDescription.contains("WFLYELY01043") && failureDescription.contains("must agree to terms of service")); } finally { removeCertificateAuthorityAccount(); removeCertificateAuthority(); removeKeyStore(ACCOUNTS_KEYSTORE_NAME); } }
Source:
public void init() { if (getConfig(ENDPOINT) == null) { throw new IllegalStateException("endpoint must be set"); } pollingTaskFactory = new Callable<Task<?>>() { public Task<?> call() { BasicTask<Void> task = new BasicTask<Void>(new Runnable() { public void run() { checkHealth(); }}); BrooklynTaskTags.setTransient(task); return task; } }; }

Target:
public void init() { getRequiredConfig(ENDPOINT); pollingTaskFactory = new Callable<Task<?>>() { @Override public Task<?> call() { BasicTask<Void> task = new BasicTask<Void>(new Runnable() { @Override public void run() { checkHealth(); }}); BrooklynTaskTags.setTransient(task); return task; } }; }
Source:
private static void logChangedDisplayNetwork( VDS vds, Collection<Network> engineHostNetworks, Collection<VdsNetworkInterface> engineInterfaces) { if (isVmRunningOnHost(vds.getId())) { final Network engineDisplayNetwork = findDisplayNetwork(engineHostNetworks); final IsNetworkOnInterfacePredicate isNetworkOnInterfacePredicate = new IsNetworkOnInterfacePredicate(engineDisplayNetwork.getName()); final VdsNetworkInterface vdsmDisplayInterface = LinqUtils.firstOrNull( vds.getInterfaces(), isNetworkOnInterfacePredicate); final VdsNetworkInterface engineDisplayInterface = LinqUtils.firstOrNull( engineInterfaces, isNetworkOnInterfacePredicate); final DisplayInterfaceEqualityPredicate displayIneterfaceEqualityPredicate = new DisplayInterfaceEqualityPredicate(engineDisplayInterface); if (vdsmDisplayInterface == null || !displayIneterfaceEqualityPredicate.eval(vdsmDisplayInterface)) { final AuditLogableBase loggable = new AuditLogableBase(); loggable.setVdsId(vds.getId()); AuditLogDirector.log(loggable, AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_HOST_WITH_ACTIVE_VM); } } }

Target:
private static void logChangedDisplayNetwork( VDS vds, Collection<Network> engineHostNetworks, Collection<VdsNetworkInterface> engineInterfaces) { if (isVmRunningOnHost(vds.getId())) { final Network engineDisplayNetwork = findDisplayNetwork(engineHostNetworks); final IsNetworkOnInterfacePredicate isNetworkOnInterfacePredicate = new IsNetworkOnInterfacePredicate(engineDisplayNetwork.getName()); final VdsNetworkInterface vdsmDisplayInterface = LinqUtils.firstOrNull( vds.getInterfaces(), isNetworkOnInterfacePredicate); final VdsNetworkInterface engineDisplayInterface = LinqUtils.firstOrNull( engineInterfaces, isNetworkOnInterfacePredicate); final DisplayInterfaceEqualityPredicate displayIneterfaceEqualityPredicate = new DisplayInterfaceEqualityPredicate(engineDisplayInterface); if (vdsmDisplayInterface == null || !displayIneterfaceEqualityPredicate.eval(vdsmDisplayInterface)) { final AuditLogableBase loggable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(loggable, AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_HOST_WITH_ACTIVE_VM); } } }
Source:
static long applicationProc(long id, long sel, long arg0, long arg1) { Display display = getCurrent(); if (display == null && id != applicationDelegate.id) { objc_super super_struct = new objc_super (); super_struct.receiver = id; super_struct.super_class = OS.objc_msgSend (id, OS.sel_superclass); return OS.objc_msgSendSuper (super_struct, sel, arg0, arg1); } if (currAppDelegate != null) { if (currAppDelegate.respondsToSelector(sel)) OS.objc_msgSend(currAppDelegate.id, sel, arg0, arg1); } if (sel == OS.sel_application_openFile_) { String file = new NSString(arg1).getString(); Event event = new Event(); event.text = file; display.sendEvent(SWT.OpenDocument, event); return 1; } else if (sel == OS.sel_application_openFiles_) { NSArray files = new NSArray(arg1); long count = files.count(); for (int i=0; i<count; i++) { String file = new NSString(files.objectAtIndex(i)).getString(); Event event = new Event(); event.text = file; display.sendEvent(SWT.OpenDocument, event); } new NSApplication(arg0).replyToOpenOrPrint(OS.NSApplicationDelegateReplySuccess); } else if (sel == OS.sel_application_openUrls_) { NSArray urls = new NSArray(arg1); int count = urls.count(); for (int i=0; i<count; i++) { String url = new NSString(urls.objectAtIndex(i)).getString(); Event event = new Event(); event.text = url; display.sendEvent(SWT.OpenUrl, event); } } else if (sel == OS.sel_applicationShouldHandleReopen_hasVisibleWindows_) { final Event event = new Event(); display.sendEvent(SWT.Activate, event); return event.doit ? 1 : 0; } return 0; }

Target:
static long applicationProc(long id, long sel, long arg0, long arg1) { Display display = getCurrent(); if (display == null && id != applicationDelegate.id) { objc_super super_struct = new objc_super (); super_struct.receiver = id; super_struct.super_class = OS.objc_msgSend (id, OS.sel_superclass); return OS.objc_msgSendSuper (super_struct, sel, arg0, arg1); } if (currAppDelegate != null) { if (currAppDelegate.respondsToSelector(sel)) OS.objc_msgSend(currAppDelegate.id, sel, arg0, arg1); } if (sel == OS.sel_application_openFile_) { String file = new NSString(arg1).getString(); Event event = new Event(); event.text = file; display.sendEvent(SWT.OpenDocument, event); return 1; } else if (sel == OS.sel_application_openFiles_) { NSArray files = new NSArray(arg1); long count = files.count(); for (int i=0; i<count; i++) { String file = new NSString(files.objectAtIndex(i)).getString(); Event event = new Event(); event.text = file; display.sendEvent(SWT.OpenDocument, event); } new NSApplication(arg0).replyToOpenOrPrint(OS.NSApplicationDelegateReplySuccess); } else if (sel == OS.sel_application_openUrls_) { NSArray urls = new NSArray(arg1); long count = urls.count(); for (int i=0; i<count; i++) { String url = new NSString(urls.objectAtIndex(i)).getString(); Event event = new Event(); event.text = url; display.sendEvent(SWT.OpenUrl, event); } } else if (sel == OS.sel_applicationShouldHandleReopen_hasVisibleWindows_) { final Event event = new Event(); display.sendEvent(SWT.Activate, event); return event.doit ? 1 : 0; } return 0; }
Source:
private Configuration buildConfiguration(String name, CacheState state) { ConfigurationBuilderHolder builderHolder = parserRegistry.parse(state.getConfiguration()); return builderHolder.getNamedConfigurationBuilders().get(name).build(); }

Target:
private Configuration buildConfiguration(String name, CacheState state) { ConfigurationBuilderHolder builderHolder = parserRegistry.parse(state.getConfiguration()); return builderHolder.getNamedConfigurationBuilders().get(name).build(configurationManager.getGlobalConfiguration()); }
Source:
public Subscriber<Observable<? extends T>> call(final Subscriber<? super T> child) { MergeSubscriber<T> subscriber = new MergeSubscriber<T>(child, delayErrors, maxConcurrent); MergeProducer<T> producer = new MergeProducer<T>(subscriber); subscriber.producer = producer; producer.lazySet(0); child.add(subscriber); child.setProducer(producer); return subscriber; }

Target:
public Subscriber<Observable<? extends T>> call(final Subscriber<? super T> child) { MergeSubscriber<T> subscriber = new MergeSubscriber<T>(child, delayErrors, maxConcurrent); MergeProducer<T> producer = new MergeProducer<T>(subscriber); subscriber.producer = producer; child.add(subscriber); child.setProducer(producer); return subscriber; }
Source:
void publishCapabilityRegistry() { primaryContext.publishCapabilityRegistry(); }

Target:
void publishCapabilityRegistry() { }
Source:
protected void draw (int part, int state, Rectangle bounds, GC gc) { if (minMaxBorderColor == null) { minMaxBorderColor = new Color (gc.getDevice(), 105, 105, 105); } switch (part) { case PART_BACKGROUND: this.drawBackground(gc, bounds, state); break; case PART_BODY: drawBody(gc, bounds, state); break; case PART_HEADER: drawTabArea(gc, bounds, state); break; case PART_MAX_BUTTON: drawMaximize(gc, bounds, state); break; case PART_MIN_BUTTON: drawMinimize(gc, bounds, state); break; case PART_CHEVRON_BUTTON: drawChevron(gc, bounds, state); break; default: if (0 <= part && part < parent.getItemCount()) { if (bounds.width == 0 || bounds.height == 0) return; if ((state & SWT.SELECTED) != 0 ) { drawSelected(part, gc, bounds, state); } else { drawUnselected(part, gc, bounds, state); } } break; } }

Target:
protected void draw (int part, int state, Rectangle bounds, GC gc) { if (minMaxBorderColor == null) { minMaxBorderColor = new Color (gc.getDevice(), 170, 170, 170); } switch (part) { case PART_BACKGROUND: this.drawBackground(gc, bounds, state); break; case PART_BODY: drawBody(gc, bounds, state); break; case PART_HEADER: drawTabArea(gc, bounds, state); break; case PART_MAX_BUTTON: drawMaximize(gc, bounds, state); break; case PART_MIN_BUTTON: drawMinimize(gc, bounds, state); break; case PART_CHEVRON_BUTTON: drawChevron(gc, bounds, state); break; default: if (0 <= part && part < parent.getItemCount()) { if (bounds.width == 0 || bounds.height == 0) return; if ((state & SWT.SELECTED) != 0 ) { drawSelected(part, gc, bounds, state); } else { drawUnselected(part, gc, bounds, state); } } break; } }
Source:
public long getAsBytes(Property property) { checkType(property, PropertyType.BYTES); String memString = get(property); if (property.getType().equals(PropertyType.MEMORY)) { return getMemoryAsBytes(memString); } else if (property.getType().equals(PropertyType.BYTES)) { return getBytes(memString); } else { throw new IllegalArgumentException(property.getKey() + " is not of BYTES or MEMORY type"); } }

Target:
public long getAsBytes(Property property) { String memString = get(property); if (property.getType() == PropertyType.MEMORY) { return getMemoryAsBytes(memString); } else if (property.getType() == PropertyType.BYTES) { return getFixedMemoryAsBytes(memString); } else { throw new IllegalArgumentException(property.getKey() + " is not of BYTES or MEMORY type"); } }
Source:
private void makeNewMenuItem() { AlertDialog.Builder alert = new AlertDialog.Builder(getActivity()); alert.setTitle("Add New Menu Item"); alert.setMessage("Input Menu Item Details"); final View AV = getLayoutInflater(getArguments()).inflate( R.layout.alert_new_menuitem, null); alert.setView(AV); alert.setPositiveButton("Save", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface d, int arg1) { String title = ((EditText) AV .findViewById(R.id.input_menuitem_title)).getText() .toString(); String desc = ((EditText) AV .findViewById(R.id.input_menuitem_desc)).getText() .toString(); String priceString = ((EditText) AV .findViewById(R.id.input_menuitem_price)).getText() .toString(); if (title.trim() == "" || priceString == "") { Toast.makeText(getActivity(), "Please input Title and Price", Toast.LENGTH_SHORT).show(); return; } double price = Double.parseDouble(priceString); MenuItem mi = new MenuItem(mAdapter.getCount() + 1, price, title, desc); currentMenu.addNewItem(mi); mAdapter.add(mi); mAdapter.notifyDataSetChanged(); mListener.onMenuItemAdded(mi); Log.v(TAG, "Adding new menu item"); } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { } }); this.newItemAlert = alert.show(); }

Target:
private void makeNewMenuItem() { AlertDialog.Builder alert = new AlertDialog.Builder(getActivity()); alert.setTitle("Add New Menu Item"); alert.setMessage("Input Menu Item Details"); final View AV = getLayoutInflater(getArguments()).inflate( R.layout.alert_new_menuitem, null); alert.setView(AV); alert.setPositiveButton("Save", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface d, int arg1) { String title = ((EditText) AV .findViewById(R.id.input_menuitem_title)).getText() .toString(); String desc = ((EditText) AV .findViewById(R.id.input_menuitem_desc)).getText() .toString(); String priceString = ((EditText) AV .findViewById(R.id.input_menuitem_price)).getText() .toString(); if (title.trim().equals("") || priceString.equals("")) { Toast.makeText(getActivity(), "Please input Title and Price", Toast.LENGTH_SHORT).show(); return; } double price = Double.parseDouble(priceString); MenuItem mi = new MenuItem(mAdapter.getCount() + 1, price, title, desc); currentMenu.addNewItem(mi); mAdapter.add(mi); mAdapter.notifyDataSetChanged(); mListener.onMenuItemAdded(mi); Log.v(TAG, "Adding new menu item"); } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { } }); this.newItemAlert = alert.show(); }
Source:
public static String getDefaultNamingContextFromNameingContexts(Attribute namingContexts) { for (int index = 0; index < namingContexts.size(); ++index) { String namingContext; try { namingContext = (String) namingContexts.get(index); } catch (NamingException e) { log.error("Failed getting naming contexts from root DSE", e); return null; } if (!namingContext.equalsIgnoreCase("o=netscaperoot")) { return namingContext; } } return null; }

Target:
public static String getDefaultNamingContextFromNameingContexts(Attribute namingContexts) { for (int index = 0; index < namingContexts.size(); ++index) { String namingContext; try { namingContext = (String) namingContexts.get(index); } catch (NamingException e) { log.error("Failed getting naming contexts from root DSE", e); return null; } if (!RHDS_NAMING_CONTEXT.equalsIgnoreCase(namingContext)) { return namingContext; } } return null; }
Source:
public User getUserByEmail(String email) { if (EmailValidator.getInstance().isValid(email)) { return dao.getUserByEmail(email); } throw new APIException("error.email.invalid", (Object[]) null); }

Target:
public User getUserByEmail(String email) { if (StringUtils.isNotBlank(email)) { return dao.getUserByEmail(email); } throw new APIException("error.email.notNullOrBlank", (Object[]) null); }
Source:
public void addCacheRegion(String name, Region region) { if ( EntityRegion.class.isInstance( region ) ) { entityRegionMap.put( name, (EntityRegion) region ); } else if ( CollectionRegion.class.isInstance( region ) ) { collectionRegionMap.put( name, (CollectionRegion) region ); } else if ( NaturalIdRegion.class.isInstance( region ) ) { naturalIdRegionMap.put( name, (NaturalIdRegion) region ); } else { otherRegionMap.put( name, region ); } }

Target:
public void addCacheRegion(String name, Region region) { boolean isOtherRegion = true; if ( EntityRegion.class.isInstance( region ) ) { entityRegionMap.put( name, (EntityRegion) region ); isOtherRegion = false; } if ( CollectionRegion.class.isInstance( region ) ) { collectionRegionMap.put( name, (CollectionRegion) region ); isOtherRegion = false; } if ( NaturalIdRegion.class.isInstance( region ) ) { naturalIdRegionMap.put( name, (NaturalIdRegion) region ); isOtherRegion = false; } if ( isOtherRegion ) { otherRegionMap.put( name, region ); } }
Source:
public void playRecord() { if (!getRecord().isEmpty()) { this.world.playEvent(null, 1010, this.pos, Item.getIdFromItem(getRecord().getItem())); } }

Target:
public void playRecord() { if (!getRecord().isEmpty()) { this.world.playEvent(null, PLAY_RECORD_EVENT, this.pos, Item.getIdFromItem(getRecord().getItem())); } }
Source:
protected void firePropertyChange(final int propertyId) { Object[] array = getListeners(); for (Object element : array) { final IPropertyListener l = (IPropertyListener) element; try { l.propertyChanged(WorkbenchPart.this, propertyId); } catch (RuntimeException e) { WorkbenchPlugin.log(e); } } }

Target:
protected void firePropertyChange(final int propertyId) { for (Object listener : getListeners()) { final IPropertyListener propertyListener = (IPropertyListener) listener; try { propertyListener.propertyChanged(WorkbenchPart.this, propertyId); } catch (RuntimeException e) { WorkbenchPlugin.log(e); } } }
Source:
public NewTableConfiguration setProperties(Map<String,String> props) { checkArgument(props != null, "properties is null"); checkDisjoint(props, samplerProps, "sampler"); checkDisjoint(props, summarizerProps, "summarizer"); checkUserTableProperties(props); this.properties = new HashMap<>(props); return this; }

Target:
public NewTableConfiguration setProperties(Map<String,String> props) { checkArgument(props != null, "properties is null"); checkDisjoint(props, samplerProps, "sampler"); checkDisjoint(props, summarizerProps, "summarizer"); checkDisjoint(props, localityProps, "locality group"); checkDisjoint(props, iteratorProps, "iterator"); checkTableProperties(props); this.properties = new HashMap<>(props); return this; }
Source:
public Aggregator factorize(final ColumnSelectorFactory metricFactory) { if (metricFactory.getColumnCapabilities(fieldName) != null && ValueType.isNumeric(metricFactory.getColumnCapabilities(fieldName).getType())) { final ColumnValueSelector<Double> valueSelector = metricFactory.makeColumnValueSelector(fieldName); if (valueSelector == null) { return new DoublesSketchNoOpAggregator(); } return new DoublesSketchBuildAggregator(valueSelector, k); } final ColumnValueSelector<DoublesSketch> selector = metricFactory.makeColumnValueSelector(fieldName); if (selector == null) { return new DoublesSketchNoOpAggregator(); } return new DoublesSketchMergeAggregator(selector, k); }

Target:
public Aggregator factorize(final ColumnSelectorFactory metricFactory) { if (metricFactory.getColumnCapabilities(fieldName) != null && ValueType.isNumeric(metricFactory.getColumnCapabilities(fieldName).getType())) { final ColumnValueSelector<Double> selector = metricFactory.makeColumnValueSelector(fieldName); if (selector instanceof NilColumnValueSelector) { return new DoublesSketchNoOpAggregator(); } return new DoublesSketchBuildAggregator(selector, k); } final ColumnValueSelector<DoublesSketch> selector = metricFactory.makeColumnValueSelector(fieldName); if (selector instanceof NilColumnValueSelector) { return new DoublesSketchNoOpAggregator(); } return new DoublesSketchMergeAggregator(selector, k); }
Source:
public void setUp() throws Exception { ConfigurationBuilder c = new ConfigurationBuilder(); c .transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL) .clustering().cacheMode(CacheMode.LOCAL) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ); cm = TestCacheManagerFactory.createCacheManager(c); cm.defineConfiguration("simple", new ConfigurationBuilder().read(c.build()) .clustering().cacheMode(CacheMode.SIMPLE) .jmxStatistics().available(false) .build()); cache = cm.getCache(); simpleCache = cm.getCache("simple"); simpleCache.addListener(new DummyListener()); skipListenerCache = cm.getCache().getAdvancedCache().withFlags(Flag.SKIP_LISTENER_NOTIFICATION); mockNotifier = mock(CacheNotifier.class); origNotifier = TestingUtil.replaceComponent(cache, CacheNotifier.class, mockNotifier, true); mockSimpleNotifier = mock(CacheNotifier.class); origSimpleNotifier = TestingUtil.replaceComponent(simpleCache, CacheNotifier.class, mockSimpleNotifier, true); }

Target:
public void setUp() throws Exception { ConfigurationBuilder c = new ConfigurationBuilder(); c .transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL) .clustering().cacheMode(CacheMode.LOCAL) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ); cm = TestCacheManagerFactory.createCacheManager(c); cache = getCache(); CacheNotifier mockNotifier = mock(CacheNotifier.class); TestingUtil.replaceComponent(cache, CacheNotifier.class, mockNotifier, true); }
Source:
public void finish() throws IOException { final InputStream inLocal = in; if (inLocal != null) { synchronized (inLocal) { if (in != null) { try { in.close(); } finally { in = null; if (decompressor != null) { try { compressAlgo.returnDecompressor(decompressor); } finally { decompressor = null; } } } } } } }

Target:
public void finish() throws IOException { synchronized (in) { if (!closed) { try { in.close(); } finally { closed = true; if (decompressor != null) { try { compressAlgo.returnDecompressor(decompressor); } finally { decompressor = null; } } } } } }
Source:
public RepositoryConnection getAndCheckRepositoryConnection() throws RepositoryResourceNoConnectionException { if (_repoConnection == null) { throw new RepositoryResourceNoConnectionException("No connection has been specified for the resource so unable to getAttachments", getId()); } return _repoConnection; }

Target:
public RepositoryConnection getAndCheckRepositoryConnection() throws RepositoryResourceNoConnectionException { if (_repoConnection == null) { throw new RepositoryResourceNoConnectionException("No connection has been specified for the resource when attemping to communicte with the repository", getId()); } return _repoConnection; }
Source:
private void seekToSync(int t) { if (t < 0) { t = 0; } playerLock.lock(); if (playerStatus == PlayerStatus.PLAYING || playerStatus == PlayerStatus.PAUSED || playerStatus == PlayerStatus.PREPARED) { if (!stream) { statusBeforeSeeking = playerStatus; setPlayerStatus(PlayerStatus.SEEKING, media); } seekLatch = new CountDownLatch(1); mediaPlayer.seekTo(t); try { seekLatch.await(10, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } } else if (playerStatus == PlayerStatus.INITIALIZED) { media.setPosition(t); startWhenPrepared.set(false); prepare(); } playerLock.unlock(); }

Target:
private void seekToSync(int t) { if (t < 0) { t = 0; } playerLock.lock(); if (playerStatus == PlayerStatus.PLAYING || playerStatus == PlayerStatus.PAUSED || playerStatus == PlayerStatus.PREPARED) { if (!stream) { statusBeforeSeeking = playerStatus; setPlayerStatus(PlayerStatus.SEEKING, media); } if(seekLatch != null && seekLatch.getCount() > 0) { try { seekLatch.await(3, TimeUnit.SECONDS); } catch (InterruptedException e) { Log.e(TAG, Log.getStackTraceString(e)); } } seekLatch = new CountDownLatch(1); mediaPlayer.seekTo(t); try { seekLatch.await(3, TimeUnit.SECONDS); } catch (InterruptedException e) { Log.e(TAG, Log.getStackTraceString(e)); } } else if (playerStatus == PlayerStatus.INITIALIZED) { media.setPosition(t); startWhenPrepared.set(false); prepare(); } playerLock.unlock(); }
Source:
private StaticServerResolver(@Parameter(NumServers.class) final int numServers, @Parameter(NumPartitions.class) final int numPartitions) { this.numPartitions = numPartitions; this.partitions = new HashMap<>(numServers); for (int i = 0; i < numServers; i++) { partitions.put(SERVER_ID_PREFIX + i, new ArrayList<Integer>()); } this.servers = new String[numPartitions]; for (int virtualNodeIndex = 0; virtualNodeIndex < servers.length; virtualNodeIndex++) { final int serverIndex = virtualNodeIndex % numServers; servers[virtualNodeIndex] = (SERVER_ID_PREFIX + serverIndex); partitions.get(SERVER_ID_PREFIX + serverIndex).add(virtualNodeIndex); } }

Target:
private StaticServerResolver(@Parameter(NumServers.class) final int numServers, @Parameter(NumPartitions.class) final int numPartitions) { this.numPartitions = numPartitions; this.serverToPartitions = new HashMap<>(numServers); for (int i = 0; i < numServers; i++) { serverToPartitions.put(SERVER_ID_PREFIX + i, new ArrayList<Integer>()); } this.partitionToServer = new String[numPartitions]; for (int partitionIndex = 0; partitionIndex < partitionToServer.length; partitionIndex++) { final int serverIndex = partitionIndex % numServers; partitionToServer[partitionIndex] = (SERVER_ID_PREFIX + serverIndex); serverToPartitions.get(SERVER_ID_PREFIX + serverIndex).add(partitionIndex); } }
Source:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { if (SecurityContextHolder.getContext().getAuthentication() != null) { chain.doFilter(request, response); return; } final boolean debug = logger.isDebugEnabled(); String header = request.getHeader("Authorization"); if (header == null || !header.startsWith("Token ")) { chain.doFilter(request, response); return; } try { String[] authHeader = TokenHelper.extractAndDecodeHeader(header); if (authHeader.length != 2) { throw new BadCredentialsException("Failed to decode basic authentication token"); } logger.debug("Decoded header with ID " + authHeader[0] + " and secret " + authHeader[1]); UUID id = UUID.fromString(authHeader[0]); String token = authHeader[1]; UserDetails user = activationTokenService.loadByActivationToken(id, token); if (user == null) { throw new CodunoNoSuchElementException("token.invalid"); } if (debug) { logger.debug("Token Authentication Authorization header found for user '" + user.getUsername() + "'. Authenticating."); } UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user, "", user.getAuthorities()); SecurityContextHolder.getContext().setAuthentication(authenticationToken); } catch (AuthenticationException failed) { SecurityContextHolder.clearContext(); if (debug) { logger.debug("Authentication request for failed: " + failed); } return; } chain.doFilter(request, response); }

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { if (SecurityContextHolder.getContext().getAuthentication() != null) { chain.doFilter(request, response); return; } final boolean debug = logger.isDebugEnabled(); String header = request.getHeader("Authorization"); if (header == null || !header.startsWith("Token ")) { chain.doFilter(request, response); return; } try { String[] authHeader = TokenHelper.decodeAndSplit(header.substring(6)); if (authHeader.length != 2) { throw new BadCredentialsException("Failed to decode basic authentication token"); } if (debug) { logger.debug("Decoded header with ID " + authHeader[0] + " and secret " + authHeader[1]); } UUID id = UUID.fromString(authHeader[0]); String token = authHeader[1]; UserDetails user = activationTokenService.loadByActivationToken(id, token); if (user == null) { throw new CodunoNoSuchElementException("token.invalid"); } if (debug) { logger.debug("Token Authentication Authorization header found for user '" + user.getUsername() + "'. Authenticating."); } UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user, "", user.getAuthorities()); SecurityContextHolder.getContext().setAuthentication(authenticationToken); } catch (AuthenticationException failed) { SecurityContextHolder.clearContext(); if (debug) { logger.debug("Authentication request for failed: " + failed); } return; } chain.doFilter(request, response); }
Source:
public Set<Entity> search(String entityType, String searchTerm) { if (!StringUtils.isEmpty(entityType) && !StringUtils.isEmpty(searchTerm)) { Set<Entity> results = new HashSet<Entity>(); EntityEnum entityEnum = EntityEnum.getEntityEnum(entityType); EntityIdentifier[] identifiers; Class<?> identifierType; if (entityEnum.isGroup()) { identifiers = GroupService.searchForGroups( searchTerm, GroupService.CONTAINS, entityEnum.getClazz()); identifierType = IEntityGroup.class; } else { identifiers = GroupService.searchForEntities( searchTerm, GroupService.CONTAINS, entityEnum.getClazz()); identifierType = entityEnum.getClazz(); } for (EntityIdentifier entityIdentifier : identifiers) { if (entityIdentifier.getType().equals(identifierType)) { IGroupMember groupMember = GroupService.getGroupMember(entityIdentifier); Entity entity = getEntity(groupMember); results.add(entity); } } return results; } return null; }

Target:
public Set<Entity> search(String entityType, String searchTerm) { if (StringUtils.isBlank(entityType) && StringUtils.isBlank(searchTerm)) { return null; } Set<Entity> results = new HashSet<Entity>(); EntityEnum entityEnum = EntityEnum.getEntityEnum(entityType); EntityIdentifier[] identifiers; Class<?> identifierType; if (entityEnum.isGroup()) { identifiers = GroupService.searchForGroups( searchTerm, GroupService.CONTAINS, entityEnum.getClazz()); identifierType = IEntityGroup.class; } else { identifiers = GroupService.searchForEntities( searchTerm, GroupService.CONTAINS, entityEnum.getClazz()); identifierType = entityEnum.getClazz(); } for (EntityIdentifier entityIdentifier : identifiers) { if (entityIdentifier.getType().equals(identifierType)) { IGroupMember groupMember = GroupService.getGroupMember(entityIdentifier); Entity entity = getEntity(groupMember); results.add(entity); } } return results; }
Source:
private DivType generatePhysicalStructMapRecursive(MediaUnit mediaUnit, Map<URI, FileType> mediaFilesToIDFiles, Map<MediaUnit, String> mediaUnitIDs, MetsType mets) { DivType div = new FileXmlElementAccess(mediaUnit).toDiv(mediaFilesToIDFiles, mediaUnitIDs, mets); for (MediaUnit child : mediaUnit.getChildren()) { div.getDiv().add(new FileXmlElementAccess(child).toDiv(mediaFilesToIDFiles, mediaUnitIDs, mets)); } return div; }

Target:
private DivType generatePhysicalStructMapRecursive(MediaUnit mediaUnit, Map<URI, FileType> mediaFilesToIDFiles, Map<MediaUnit, String> mediaUnitIDs, MetsType mets) { DivType div = new FileXmlElementAccess(mediaUnit).toDiv(mediaFilesToIDFiles, mediaUnitIDs, mets); for (MediaUnit child : mediaUnit.getChildren()) { div.getDiv().add(generatePhysicalStructMapRecursive(child, mediaFilesToIDFiles, mediaUnitIDs, mets)); } return div; }
Source:
private void validateSources(List<ComposeSource> sources) { if (sources.isEmpty()) { throw new IllegalArgumentException("compose sources cannot be empty"); } }

Target:
private void validateSources(List<ComposeSource> sources) { if (sources == null || sources.isEmpty()) { throw new IllegalArgumentException("compose sources cannot be empty"); } }
Source:
private boolean isAPIUrl(String url) { Pattern pattern = Pattern.compile("^((.*/api/.*)|(.*[^/]+\\.(xml|json)(\\?.*)?))$"); Matcher matcher = pattern.matcher(url); return matcher.matches(); }

Target:
private boolean isAPIUrl(String url) { Matcher matcher = PATTERN.matcher(url); return matcher.matches(); }
Source:
private static void fixDistributedApproxCountDistinct( AggregatePlanNode distNode, AggregatePlanNode coordNode) { assert (distNode != null); assert (coordNode != null); List<ExpressionType> distAggTypes = distNode.getAggregateTypes(); boolean hasApproxCountDistinct = false; for (int i = 0; i < distAggTypes.size(); ++i) { ExpressionType et = distAggTypes.get(i); if (et == ExpressionType.AGGREGATE_APPROX_COUNT_DISTINCT) { hasApproxCountDistinct = true; distNode.updateAggregate(i, ExpressionType.AGGREGATE_VALS_TO_HYPERLOGLOG); } } List<ExpressionType> coordAggTypes = coordNode.getAggregateTypes(); for (int i = 0; i < coordAggTypes.size(); ++i) { coordNode.updateWorkerOrCoordinator(i); if (coordNode.getUserAggregateId() != -1) { String typeName = FunctionDescriptor.getReturnType(coordNode.getUserAggregateId()).getNameString(); VoltType returnType = VoltType.typeFromString(typeName); coordNode.getOutputSchema().getColumn(0).getExpression().setValueType(returnType); distNode.updateAggregate(i, ExpressionType.USER_DEFINE_WORKER); } } if (hasApproxCountDistinct) { for (int i = 0; i < coordAggTypes.size(); ++i) { ExpressionType et = coordAggTypes.get(i); if (et == ExpressionType.AGGREGATE_APPROX_COUNT_DISTINCT) { coordNode.updateAggregate(i, ExpressionType.AGGREGATE_HYPERLOGLOGS_TO_CARD); } } } }

Target:
private static void fixDistributedApproxCountDistinct( AggregatePlanNode distNode, AggregatePlanNode coordNode) { assert (distNode != null); assert (coordNode != null); List<ExpressionType> distAggTypes = distNode.getAggregateTypes(); boolean hasApproxCountDistinct = false; for (int i = 0; i < distAggTypes.size(); ++i) { ExpressionType et = distAggTypes.get(i); if (et == ExpressionType.AGGREGATE_APPROX_COUNT_DISTINCT) { hasApproxCountDistinct = true; distNode.updateAggregate(i, ExpressionType.AGGREGATE_VALS_TO_HYPERLOGLOG); } } if (hasApproxCountDistinct) { List<ExpressionType> coordAggTypes = coordNode.getAggregateTypes(); for (int i = 0; i < coordAggTypes.size(); ++i) { ExpressionType et = coordAggTypes.get(i); if (et == ExpressionType.AGGREGATE_APPROX_COUNT_DISTINCT) { coordNode.updateAggregate(i, ExpressionType.AGGREGATE_HYPERLOGLOGS_TO_CARD); } } } }
Source:
public void run() { boolean hasSavedFilter = fTimeEventFilterDialog != null && fTimeEventFilterDialog.hasActiveSavedFilters(); getTimeGraphViewer().setSavedFilterStatus(hasSavedFilter || !fIsHideRowsFilterActive); fIsHideRowsFilterActive = !fIsHideRowsFilterActive; restartZoomThread(); if(fIsHideRowsFilterActive) { setImageDescriptor(HIDE_EMPTY_ROWS); setToolTipText(org.eclipse.tracecompass.internal.tmf.ui.views.timegraph.Messages.AbstractTimeGraphView_HideRowsActionTooltip); } else { setImageDescriptor(SHOW_EMPTY_ROWS); setToolTipText(org.eclipse.tracecompass.internal.tmf.ui.views.timegraph.Messages.AbstractTimeGraphView_ShowRowsActionTooltip); } }

Target:
public void run() { boolean hasSavedFilter = fTimeEventFilterDialog != null && fTimeEventFilterDialog.hasActiveSavedFilters(); boolean isChecked = isChecked(); getTimeGraphViewer().setSavedFilterStatus(hasSavedFilter || !isChecked); fIsHideRowsFilterActive = !isChecked; restartZoomThread(); }
Source:
public void testInheritanceCycle() throws Exception { String error = tapSystemErr(() -> { int exitStatus = catchSystemExit(() -> DynamicConfigValidator.main(new String[] { "--configDir", "src/test/resources/validator/bad_cyclic_inheritance" })); assertEquals(2, exitStatus); }); assertEquals("Inheriting from table 'A' creates an illegal cyclic dependency.\n", error); }

Target:
public void testInheritanceCycle() throws Exception { String error = tapSystemErr(() -> { int exitStatus = catchSystemExit(() -> DynamicConfigValidator.main(new String[] { "--configDir", "src/test/resources/validator/bad_cyclic_inheritance" })); assertEquals(2, exitStatus); }); assertTrue(error.contains("Inheriting from table")); assertTrue(error.contains("creates an illegal cyclic dependency.")); }
Source:
public void dispose() { super.dispose(); disposeWidget(enableTracingButton); disposeWidget(tracingTreeTitleLabel); disposeWidget(filterTree); disposeWidget(tracingOptionsGroup); disposeWidget(tracingOutputFileButton); disposeWidget(tracingFileText); disposeWidget(tracingFileBrowseButton); disposeWidget(tracingFileMaxCountLabel); disposeWidget(maximumFileCountSpinner); disposeWidget(tracingFileMaxSizeLabel); disposeWidget(maximumFileSizeSpinner); purgeModel(); }

Target:
public void dispose() { super.dispose(); disposeWidget(enableTracingButton); disposeWidget(tracingTreeTitleLabel); disposeWidget(filterTree); disposeWidget(tracingOptionsGroup); disposeWidget(tracingOutputFileButton); disposeWidget(tracingFileText); disposeWidget(tracingFileBrowseButton); disposeWidget(tracingFileMaxCountLabel); disposeWidget(maximumFileCountSpinner); disposeWidget(tracingFileMaxSizeLabel); disposeWidget(maximumFileSizeSpinner); disposeWidget(standardOutputStreamButton); purgeModel(); }