auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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) || <START> (null == httpResponse.getEntity())) <END> 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; }</code><technical_language>if brackets is code practice generally, think</technical_language>

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:
<code>public OnSubscribeToMap(Observable<T> source, Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) { <START> this(source, keySelector, valueSelector, DefaultMapFactory.<K, V>instance()); <END> }</code><technical_language>A small trick: OnSubscribeToMap implement Func0<Map<K, V>> assign this map factory function - of this() constructor delegation assign final fields explicitly. This way, is need for extra class</technical_language>

Target:
public OnSubscribeToMap(Observable<T> source, Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) { this(source, keySelector, valueSelector, null); }
Source:
<code>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, <START> ALERTS_CASSANDRA_MAX_QUEUE_ENV, "9182")); <END> }</code><technical_language>is this setting for</technical_language>

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:
<code>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); <START> if (!Arrays.asList(EntityType.FEED.toString().toLowerCase(), EntityType.PROCESS.toString().toLowerCase()). <END> 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); }</code><technical_language>instead type != EntityType.FEED || type != EntityType.PROCESS</technical_language>

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:
<code>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) { <START> assertFalse(true); <END> } 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; }</code><technical_language>exception propagate</technical_language>

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:
<code>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( <START> "Unrecognized relationship " + relationship + "for validator " + this.toString()); <END> } 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(); } }</code><technical_language>Needs space "for". Also, this point of state variables set toString() useful</technical_language>

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:
<code>public void testCreateAccountWithoutAgreeingToTermsOfService() throws Exception { String alias = "invalid"; addKeyStore(ACCOUNTS_KEYSTORE_NAME); <START> addCertificateAuthorityWithoutStagingUrl(); <END> 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); } }</code><technical_language>I this assertion operation fail attempting get failure description</technical_language>

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:
<code>public void init() { if (getConfig(ENDPOINT) == null) { throw new IllegalStateException("endpoint must be set"); <START> } <END> pollingTaskFactory = new Callable<Task<?>>() { public Task<?> call() { BasicTask<Void> task = new BasicTask<Void>(new Runnable() { public void run() { checkHealth(); }}); BrooklynTaskTags.setTransient(task); return task; } }; }</code><technical_language>Add policy-flavoured getRequiredConfig() ConfigUtils</technical_language>

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:
<code>private static void logChangedDisplayNetwork( VDS vds, <START> Collection<Network> engineHostNetworks, <END> 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); } } }</code><technical_language>engine prefix for variable name is redundant</technical_language>

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:
<code>private Configuration buildConfiguration(String name, CacheState state) { ConfigurationBuilderHolder builderHolder = parserRegistry.parse(state.getConfiguration()); <START> return builderHolder.getNamedConfigurationBuilders().get(name).build(); <END> }</code><technical_language>if this is ok. Some attributes validated global configuration, valid current global configuration</technical_language>

Target:
private Configuration buildConfiguration(String name, CacheState state) { ConfigurationBuilderHolder builderHolder = parserRegistry.parse(state.getConfiguration()); return builderHolder.getNamedConfigurationBuilders().get(name).build(configurationManager.getGlobalConfiguration()); }
Source:
<code>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; <START> producer.lazySet(0); END> child.add(subscriber); child.setProducer(producer); return subscriber; }</code><technical_language>is this lazySet about? visibility work if this done</technical_language>

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:
<code>void publishCapabilityRegistry() { <START> primaryContext.publishCapabilityRegistry(); <END> }</code><technical_language>This a no-op. primary context controls publication is ready; ParallelBootOperationContexts happened bit</technical_language>

Target:
void publishCapabilityRegistry() { }
Source:
<code>protected void draw (int part, int state, Rectangle bounds, GC gc) { if (minMaxBorderColor == null) { <START> minMaxBorderColor = new Color (gc.getDevice(), 105, 105, 105); <END> } 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; } }</code><technical_language>Hardcoding color is a themes UI toolkits match this for sure</technical_language>

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:
<code>public long getAsBytes(Property property) { checkType(property, PropertyType.BYTES); String memString = get(property); <START> if (property.getType().equals(PropertyType.MEMORY)) { <END> 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"); } }</code><technical_language>== for enum comparison. helps type checking, also, .equals mask type errors, accepts Object</technical_language>

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:
<code>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(); <START> if (title.trim() == "" || priceString == "") { <END> 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(); }</code><technical_language>give warning? Findbugs reported error I ran it, I changed equals warning away</technical_language>

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:
<code>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")) { <START> return namingContext; <END> } } return null; }</code><technical_language>avoid NPE "o=netscaperoot".equalsIgnoreCase(namingContext)</technical_language>

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:
<code>public User getUserByEmail(String email) { <START> if (EmailValidator.getInstance().isValid(email)) { <END> return dao.getUserByEmail(email); } throw new APIException("error.email.invalid", (Object[]) null); }</code><technical_language>supposed check if email is null blank, this method's job validate email</technical_language>

Target:
public User getUserByEmail(String email) { if (StringUtils.isNotBlank(email)) { return dao.getUserByEmail(email); } throw new APIException("error.email.notNullOrBlank", (Object[]) null); }
Source:
<code>public void addCacheRegion(String name, Region region) { if ( EntityRegion.class.isInstance( region ) ) { entityRegionMap.put( name, (EntityRegion) region ); } <START> else if ( CollectionRegion.class.isInstance( region ) ) { <END> collectionRegionMap.put( name, (CollectionRegion) region ); } else if ( NaturalIdRegion.class.isInstance( region ) ) { naturalIdRegionMap.put( name, (NaturalIdRegion) region ); } else { otherRegionMap.put( name, region ); } }</code><technical_language>instance implement multiple region types; added collections if matches (dropping elses)</technical_language>

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:
<code>public void playRecord() { if (!getRecord().isEmpty()) { <START> this.world.playEvent(null, 1010, this.pos, Item.getIdFromItem(getRecord().getItem())); <END> } }</code><technical_language>a magic number in more a single location. move a constant</technical_language>

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

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:
<code>public NewTableConfiguration setProperties(Map<String,String> props) { checkArgument(props != null, "properties is null"); checkDisjoint(props, samplerProps, "sampler"); checkDisjoint(props, summarizerProps, "summarizer"); <START> checkUserTableProperties(props); <END> this.properties = new HashMap<>(props); return this; }</code><technical_language>check checks java checkDisjoint(props, localityProps, "locality group"); checkDisjoint(props, iteratorProps, "iterator");</technical_language>

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:
<code>public Aggregator factorize(final ColumnSelectorFactory metricFactory) { if (metricFactory.getColumnCapabilities(fieldName) != null && ValueType.isNumeric(metricFactory.getColumnCapabilities(fieldName).getType())) { final ColumnValueSelector<Double> valueSelector = metricFactory.makeColumnValueSelector(fieldName); <START> if (valueSelector == null) { <END> 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); }</code><technical_language>curious this null. I find it</technical_language>

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:
<code>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); <START> origSimpleNotifier = TestingUtil.replaceComponent(simpleCache, CacheNotifier.class, mockSimpleNotifier, true); <END> }</code><technical_language>write a separate test for SimpleCacheImpl</technical_language>

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:
<code>public void finish() throws IOException { final InputStream inLocal = in; if (inLocal != null) { synchronized (inLocal) { if (in != null) { try { in.close(); } finally { <START> in = null; <END> if (decompressor != null) { try { compressAlgo.returnDecompressor(decompressor); } finally { decompressor = null; } } } } } } }</code><technical_language>a boolean track closed avoid inLocal double check</technical_language>

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:
<code>public RepositoryConnection getAndCheckRepositoryConnection() throws RepositoryResourceNoConnectionException { if (_repoConnection == null) { <START> throw new RepositoryResourceNoConnectionException("No connection has been specified for the resource so unable to getAttachments", getId()); <END> } return _repoConnection; }</code><technical_language>exception message wrong. is talking attachments</technical_language>

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:
<code>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 { <START> seekLatch.await(10, TimeUnit.SECONDS); <END> } catch (InterruptedException e) { e.printStackTrace(); } } else if (playerStatus == PlayerStatus.INITIALIZED) { media.setPosition(t); startWhenPrepared.set(false); prepare(); } playerLock.unlock(); }</code><technical_language>do want wait 10 seconds? a long time</technical_language>

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:
<code>private StaticServerResolver(@Parameter(NumServers.class) final int numServers, @Parameter(NumPartitions.class) final int numPartitions) { this.numPartitions = numPartitions; <START> this.partitions = new HashMap<>(numServers); <END> 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); } }</code><technical_language>This name "partitions" is slightly confusing me. serverToPartitions</technical_language>

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:
<code>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"); } <START> logger.debug("Decoded header with ID " + authHeader[0] + " and secret " + authHeader[1]); <END> 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); }</code><technical_language>Wrap this if (debug)</technical_language>

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:
<code>public Set<Entity> search(String entityType, String searchTerm) { <START> if (!StringUtils.isEmpty(entityType) && !StringUtils.isEmpty(searchTerm)) { <END> 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; }</code><technical_language>Consider StringUtils.isNotEmpty(x) !StringUtils.isEmpty(x). Syntactic sugar for win. Consider isBlank() isEmpty() do right Strings consisting purely of whitespace</technical_language>

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:
<code>private DivType generatePhysicalStructMapRecursive(MediaUnit mediaUnit, Map<URI, FileType> mediaFilesToIDFiles, <START> Map<MediaUnit, String> mediaUnitIDs, MetsType mets) { <END> 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; }</code><technical_language>generateFileSecRecursive is recursive, is recursive part here</technical_language>

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:
<code>private void validateSources(List<ComposeSource> sources) { <START> if (sources.isEmpty()) { <END> throw new IllegalArgumentException("compose sources cannot be empty"); } }</code><technical_language>null check needs done for sources</technical_language>

Target:
private void validateSources(List<ComposeSource> sources) { if (sources == null || sources.isEmpty()) { throw new IllegalArgumentException("compose sources cannot be empty"); } }
Source:
<code>private boolean isAPIUrl(String url) { <START> Pattern pattern = Pattern.compile("^((.*/api/.*)|(.*[^/]+\\.(xml|json)(\\?.*)?))$"); <END> Matcher matcher = pattern.matcher(url); return matcher.matches(); }</code><technical_language>Compiling patterns expensive operation perform request. consider making this a constant</technical_language>

Target:
private boolean isAPIUrl(String url) { Matcher matcher = PATTERN.matcher(url); return matcher.matches(); }
Source:
<code>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); } } <START> List<ExpressionType> coordAggTypes = coordNode.getAggregateTypes(); <END> 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); } } } }</code><technical_language>Need a separate function? fixDistributedApproxCountDistinct is handling user-defined functions</technical_language>

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:
<code>public void run() { boolean hasSavedFilter = fTimeEventFilterDialog != null && fTimeEventFilterDialog.hasActiveSavedFilters(); getTimeGraphViewer().setSavedFilterStatus(hasSavedFilter || !fIsHideRowsFilterActive); fIsHideRowsFilterActive = !fIsHideRowsFilterActive; restartZoomThread(); <START> 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); } <END> }</code><technical_language>Needs inverted hide row filter is active need button user rows shown vice-versa. Currently icon hide rows shown rows hidden</technical_language>

Target:
public void run() { boolean hasSavedFilter = fTimeEventFilterDialog != null && fTimeEventFilterDialog.hasActiveSavedFilters(); boolean isChecked = isChecked(); getTimeGraphViewer().setSavedFilterStatus(hasSavedFilter || !isChecked); fIsHideRowsFilterActive = !isChecked; restartZoomThread(); }
Source:
<code>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); }); <START> assertEquals("Inheriting from table 'A' creates an illegal cyclic dependency.\n", error); <END> }</code><technical_language>curious, change in this PR need this test case updated</technical_language>

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:
<code>public void dispose() { super.dispose(); disposeWidget(enableTracingButton); disposeWidget(tracingTreeTitleLabel); disposeWidget(filterTree); disposeWidget(tracingOptionsGroup); <START> disposeWidget(tracingOutputFileButton); <END> disposeWidget(tracingFileText); disposeWidget(tracingFileBrowseButton); disposeWidget(tracingFileMaxCountLabel); disposeWidget(maximumFileCountSpinner); disposeWidget(tracingFileMaxSizeLabel); disposeWidget(maximumFileSizeSpinner); purgeModel(); }</code><technical_language>entry for standardOutputGroupButton This entire section is unecessary controls disposed parent control is disposed, minimum consistent</technical_language>

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(); }