auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onCollectionLoaded(Collection col) { super.onCollectionLoaded(col); mTemplateAdapter = new TemplatePagerAdapter(getSupportFragmentManager()); mTemplateAdapter.setModel(col.getModels().get(mModelId)); mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mTemplateAdapter); mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(final int position, final float v, final int i2) { } @Override public void onPageSelected(final int position) { CardTemplateFragment fragment = (CardTemplateFragment) mTemplateAdapter.instantiateItem(mViewPager, position); if (fragment != null) { fragment.updateCss(); } } @Override public void onPageScrollStateChanged(final int position) { } }); mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager(mViewPager); if (getSupportActionBar() != null) { getSupportActionBar().setTitle(R.string.title_activity_template_editor); getSupportActionBar().setSubtitle(col.getModels().get(mModelId).optString("name")); } try { if (mModelBackup == null) { mModelBackup = new JSONObject(col.getModels().get(mModelId).toString()); } } catch (JSONException e) { throw new RuntimeException(e); } Timber.i("CardTemplateEditor:: Card template editor successfully started for model id %d", mModelId); if (mCardId != -1L) { try { Card currentCard = getCol().getCard(mCardId); JSONArray tmpls = mTemplateAdapter.mModel.getJSONArray("tmpls"); for (int tabIndex = 0; tabIndex < tmpls.length(); tabIndex++) { if (currentCard.template().optString("name").equals(tmpls.getJSONObject(tabIndex).optString("name"))) { mViewPager.setCurrentItem(tabIndex); } } } catch (JSONException e) { throw new RuntimeException(e); } } }

Target:
protected void onCollectionLoaded(Collection col) { super.onCollectionLoaded(col); mTemplateAdapter = new TemplatePagerAdapter(getSupportFragmentManager()); mTemplateAdapter.setModel(col.getModels().get(mModelId)); mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mTemplateAdapter); mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(final int position, final float v, final int i2) { } @Override public void onPageSelected(final int position) { CardTemplateFragment fragment = (CardTemplateFragment) mTemplateAdapter.instantiateItem(mViewPager, position); if (fragment != null) { fragment.updateCss(); } } @Override public void onPageScrollStateChanged(final int position) { } }); mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager(mViewPager); if (getSupportActionBar() != null) { getSupportActionBar().setTitle(R.string.title_activity_template_editor); getSupportActionBar().setSubtitle(col.getModels().get(mModelId).optString("name")); } try { if (mModelBackup == null) { mModelBackup = new JSONObject(col.getModels().get(mModelId).toString()); } } catch (JSONException e) { throw new RuntimeException(e); } Timber.i("CardTemplateEditor:: Card template editor successfully started for model id %d", mModelId); if (mOrdId != -1) { mViewPager.setCurrentItem(mOrdId); } }
Source:
public Option<Command> localChangesAboutToCommit(Collection<Notification> notifications) { Command command = null; Collection<Edge> edgesWithCreatedCommand = new HashSet<Edge>(); Collection<AbstractModelChangeOperation<Void>> operations = new ArrayList<AbstractModelChangeOperation<Void>>(); Map<Notification, Edge> notifToEdge = new HashMap<>(); Map<Notification, Node> notifToNode = new HashMap<>(); List<View> movedOrResizedViews = new ArrayList<>(); prepareData(notifications, notifToEdge, notifToNode, movedOrResizedViews); for (Notification notification : notifications) { Optional<Edge> optionalGmfEdge = getCorrespondingEdge(notification, notifToEdge); if (optionalGmfEdge.isPresent()) { boolean isChangedIntoOblique = changeIntoOblique(operations, notification, optionalGmfEdge.get()); if (isRefreshEdgeLayoutNeededForNotification(notification, notifToEdge, movedOrResizedViews) && !isChangedIntoOblique) { if (edgesWithCreatedCommand.add(optionalGmfEdge.get())) { boolean useFigure = otherNotificationsAreConsequences(notification, optionalGmfEdge.get(), notifications, notifToEdge); AbstractModelChangeOperation<Void> operation = new CenterEdgeEndModelChangeOperation(optionalGmfEdge.get(), useFigure); operations.add(operation); } } } } if (!operations.isEmpty()) { command = new EdgeLayoutUpdaterCommand(domain, operations); } return Options.newSome(command); }

Target:
public Option<Command> localChangesAboutToCommit(Collection<Notification> notifications) { Command command = null; Collection<Edge> edgesWithCreatedCommand = new HashSet<Edge>(); Collection<AbstractModelChangeOperation<Void>> operations = new ArrayList<AbstractModelChangeOperation<Void>>(); Map<Notification, Edge> notifToEdge = new HashMap<>(); Map<Notification, Node> notifToNode = new HashMap<>(); List<View> movedOrResizedViews = new ArrayList<>(); prepareData(notifications, notifToEdge, notifToNode, movedOrResizedViews); for (Notification notification : notifications) { boolean isChangedIntoOblique = changeIntoOblique(operations, notification, notifToEdge); if (isRefreshEdgeLayoutNeededForNotification(notification, notifToEdge, movedOrResizedViews) && !isChangedIntoOblique) { Optional<Edge> optionalGmfEdge = getCorrespondingEdge(notification, notifToEdge); if (optionalGmfEdge.isPresent() && edgesWithCreatedCommand.add(optionalGmfEdge.get())) { boolean useFigure = otherNotificationsAreConsequences(notification, optionalGmfEdge.get(), notifications, notifToEdge); AbstractModelChangeOperation<Void> operation = new CenterEdgeEndModelChangeOperation(optionalGmfEdge.get(), useFigure); operations.add(operation); } } } if (!operations.isEmpty()) { command = new EdgeLayoutUpdaterCommand(domain, operations); } return Options.newSome(command); }
Source:
public Resource minify(Resource originalResource, String filename) { if (!getEnabled()) { LOG.trace(MINIFICATION_IS_DISABLED_RETURNING_ORIGINAL_RESOURCE); return originalResource; } String type = getFileType(originalResource, filename); if (type == null) { LOG.trace("Unsupported minification resource: " + filename); return originalResource; } try (BufferedReader in = new BufferedReader(new InputStreamReader(originalResource.getInputStream(), "utf-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(baos, "utf-8"));) { minify(in, out, filename, type); out.flush(); return new GeneratedResource(baos.toByteArray(), filename); } catch (Exception e) { LOG.warn(COULD_NOT_MINIFY_RESOURCES_RETURNED_UNMINIFIED_BYTES, e); return originalResource; } }

Target:
public Resource minify(Resource originalResource, String filename) { if (!getEnabled()) { LOG.trace(MINIFICATION_IS_DISABLED_RETURNING_ORIGINAL_RESOURCE); return originalResource; } String type = getFileType(originalResource, filename); if (type == null) { LOG.info("Unsupported minification resource: " + filename); return originalResource; } try (BufferedReader in = new BufferedReader(new InputStreamReader(originalResource.getInputStream(), "utf-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(baos, "utf-8"));) { minify(in, out, filename, type); out.flush(); return new GeneratedResource(baos.toByteArray(), filename); } catch (Exception e) { LOG.warn(COULD_NOT_MINIFY_RESOURCES_RETURNED_UNMINIFIED_BYTES, e); return originalResource; } }
Source:
public Response postRequest(URI url, String payload, Map<String, String> headers, MediaType mediaType, String metricsPrefix) throws GatewayClientException, GatewayException, DownstreamException { Stopwatch responseTimeStopwatch = Stopwatch.createStarted(); Response response; try { logger.info("POSTing request for gateway url={}", url); Invocation.Builder clientBuilder = client.target(url.toString()).request(); headers.keySet().forEach(headerKey -> clientBuilder.header(headerKey, headers.get(headerKey))); response = clientBuilder.post(Entity.entity(payload, mediaType)); throwIfErrorResponse(response, metricsPrefix); } catch (Exception e) { metricRegistry.counter(metricsPrefix + ".failures").inc(); logger.error(format("Exception for gateway url=%s", url.toString()), e); throw new GatewayException(url.toString(), e); } finally { responseTimeStopwatch.stop(); metricRegistry.histogram(metricsPrefix + ".response_time").update(responseTimeStopwatch.elapsed(TimeUnit.MILLISECONDS)); } return response; }

Target:
public Response postRequest(URI url, String payload, Map<String, String> headers, MediaType mediaType, String metricsPrefix) throws GatewayClientException, GatewayException, DownstreamException { Stopwatch responseTimeStopwatch = Stopwatch.createStarted(); Response response; try { logger.info("POSTing request for gateway url={}", url); Invocation.Builder clientBuilder = client.target(url.toString()).request(); headers.keySet().forEach(headerKey -> clientBuilder.header(headerKey, headers.get(headerKey))); response = clientBuilder.post(Entity.entity(payload, mediaType)); } catch (Exception e) { metricRegistry.counter(metricsPrefix + ".failures").inc(); logger.error(format("Exception for gateway url=%s", url.toString()), e); throw new GatewayException(url.toString(), e); } finally { responseTimeStopwatch.stop(); metricRegistry.histogram(metricsPrefix + ".response_time").update(responseTimeStopwatch.elapsed(TimeUnit.MILLISECONDS)); } throwIfErrorResponse(response, metricsPrefix); return response; }
Source:
private boolean isPausableMethod(Method pausableMethod) { Class<?> declaringClass = pausableMethod.getDeclaringClass(); return (Pausable.class.isAssignableFrom(declaringClass) || Lifecycle.class.isAssignableFrom(declaringClass)) && ReflectionUtils.findMethod(Pausable.class, pausableMethod.getName(), pausableMethod.getParameterTypes()) != null; }

Target:
private boolean isPausableMethod(Method pausableMethod) { Class<?> declaringClass = pausableMethod.getDeclaringClass(); boolean pausable = (Pausable.class.isAssignableFrom(declaringClass) || Lifecycle.class.isAssignableFrom(declaringClass)) && ReflectionUtils.findMethod(Pausable.class, pausableMethod.getName(), pausableMethod.getParameterTypes()) != null; if (pausable && this.logger.isTraceEnabled()) { this.logger.trace(pausableMethod + " is not considered a candidate method unless explicitly requested"); } return pausable; }
Source:
public <T extends Annotation> T getAnnotation(Class<T> annotationType) { return delegate.getAnnotation(annotationType); }

Target:
public <T extends Annotation> T getAnnotation(Class<T> annotationType) { for (Annotation annotation : annotations) { if (annotation.annotationType().equals(annotationType)) { return annotationType.cast(annotation); } } return null; }
Source:
public void testRead() throws Exception { ByteBuf buf = Unpooled.buffer(16); buf.writeBytes(new byte[]{1, 2, 3, 4, 5, 6}); ByteBufInputStream in = new ByteBufInputStream(buf, 3); assertEquals(1, in.read()); assertEquals(2, in.read()); assertEquals(3, in.read()); assertEquals(-1, in.read()); assertEquals(-1, in.read()); assertEquals(-1, in.read()); ByteBuf buf2 = Unpooled.buffer(16); buf2.writeBytes(new byte[]{1, 2, 3, 4, 5, 6}); ByteBufInputStream in2 = new ByteBufInputStream(buf2, 4); assertEquals(1, in2.read()); assertEquals(2, in2.read()); assertEquals(3, in2.read()); assertEquals(4, in2.read()); assertNotEquals(5, in2.read()); assertEquals(-1, in2.read()); }

Target:
public void testRead() throws Exception { ByteBuf buf = Unpooled.buffer(16); buf.writeBytes(new byte[]{1, 2, 3, 4, 5, 6}); ByteBufInputStream in = new ByteBufInputStream(buf, 3); assertEquals(1, in.read()); assertEquals(2, in.read()); assertEquals(3, in.read()); assertEquals(-1, in.read()); assertEquals(-1, in.read()); assertEquals(-1, in.read()); buf.release(); in.close(); ByteBuf buf2 = Unpooled.buffer(16); buf2.writeBytes(new byte[]{1, 2, 3, 4, 5, 6}); ByteBufInputStream in2 = new ByteBufInputStream(buf2, 4); assertEquals(1, in2.read()); assertEquals(2, in2.read()); assertEquals(3, in2.read()); assertEquals(4, in2.read()); assertNotEquals(5, in2.read()); assertEquals(-1, in2.read()); buf2.release(); in2.close(); }
Source:
public synchronized ExtendedLogEntry getEntryX() { ExtendedLogEntry current = (ExtendedLogEntry) entry; entry = null; return current; }

Target:
public synchronized ExtendedLogEntry getEntryX() throws InterruptedException { return getEntryX(20000); }
Source:
public static boolean deleteVM(String hostIpPort, String id) { String ret = null; URL url = null; try { CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL)); url = new URL("http://" + hostIpPort + "/compute/" + id); } catch (MalformedURLException e) { e.printStackTrace(); } HttpURLConnection httpURLConnection = null; DataInputStream in = null; try { httpURLConnection = (HttpURLConnection) url.openConnection(); httpURLConnection.setRequestMethod("DELETE"); httpURLConnection.setRequestProperty("Content-Type", "text/occi"); httpURLConnection.setRequestProperty("Accept", "* } } if (httpURLConnection != null) { httpURLConnection.disconnect(); } } return ("OK".equalsIgnoreCase(ret)); }

Target:
public static boolean deleteVM(String hostIpPort, String id) throws TargetException { String ret = null; URL url = null; try { CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL)); url = new URL("http://" + hostIpPort + "/compute/" + id); } catch (MalformedURLException e) { throw new TargetException(e); } HttpURLConnection httpURLConnection = null; DataInputStream in = null; try { httpURLConnection = (HttpURLConnection) url.openConnection(); httpURLConnection.setRequestMethod("DELETE"); httpURLConnection.setRequestProperty("Content-Type", "text/occi"); httpURLConnection.setRequestProperty("Accept", "*/*"); in = new DataInputStream(httpURLConnection.getInputStream()); ByteArrayOutputStream out = new ByteArrayOutputStream(); Utils.copyStreamSafely(in, out); ret = out.toString(); } catch (IOException e) { throw new TargetException(e); } finally { Utils.closeQuietly(in); if (httpURLConnection != null) { httpURLConnection.disconnect(); } } return ("OK".equalsIgnoreCase(ret)); }
Source:
public BatchUpdate addRefUpdate(ReceiveCommand cmd) { batchRefUpdate.addCommand(cmd); return this; }

Target:
public BatchUpdate addRefUpdate(ReceiveCommand cmd) { getBatchRefUpdate().addCommand(cmd); return this; }
Source:
public RoutingTableSnapshot(RoutingTable routingTable) { _routingTable = routingTable; _propertyType = routingTable.getPropertyType(); _customizedStateType = routingTable.getCustomizedStateType(); }

Target:
public RoutingTableSnapshot(RoutingTable routingTable) { _routingTable = routingTable; _propertyType = routingTable.getPropertyType(); _stateType = routingTable.getStateType(); }
Source:
private List<PrometheusMetric> scrapeBean(MBeanServer beanServer, ObjectName beanName, Map<ObjectName, LinkedHashMap<String, String>> keyPropertiesPerBean) { try { MBeanInfo beanInfo = beanServer.getMBeanInfo(beanName); MBeanAttributeInfo[] beanAttributes = beanInfo.getAttributes(); Map<String, MBeanAttributeInfo> attributeMap = new HashMap<>(); for (MBeanAttributeInfo attribute : beanAttributes) { if (attribute.isReadable()) { attributeMap.put(attribute.getName(), attribute); } } AttributeList attributes = beanServer.getAttributes(beanName, attributeMap.keySet().toArray(new String[0])); List<PrometheusMetric> metrics = new ArrayList<>(); for (Attribute attribute : attributes.asList()) { MBeanAttributeInfo attributeInfo = attributeMap.get(attribute.getName()); PrometheusMetric metric = processBeanValue(toSnakeAndLowerCase(beanName.getDomain()), toSnakeAndLowerCase(attributeInfo.getName()), attributeInfo.getDescription(), attribute.getValue(), getKeyPropertyList(keyPropertiesPerBean, beanName)); if (metric != null) { metrics.add(metric); } } return metrics; } catch (ReflectionException | IntrospectionException | InstanceNotFoundException e) { LOGGER.error("Error in scraping bean - " + beanName.toString()); } return Collections.emptyList(); }

Target:
private List<PrometheusMetric> scrapeBean(MBeanServer beanServer, ObjectName beanName, Map<ObjectName, LinkedHashMap<String, String>> keyPropertiesPerBean) { try { MBeanInfo beanInfo = beanServer.getMBeanInfo(beanName); MBeanAttributeInfo[] beanAttributes = beanInfo.getAttributes(); Map<String, MBeanAttributeInfo> attributeMap = new HashMap<>(); for (MBeanAttributeInfo attribute : beanAttributes) { if (attribute.isReadable()) { attributeMap.put(attribute.getName(), attribute); } } AttributeList attributes = beanServer.getAttributes(beanName, attributeMap.keySet().toArray(new String[0])); List<PrometheusMetric> metrics = new ArrayList<>(); for (Attribute attribute : attributes.asList()) { MBeanAttributeInfo attributeInfo = attributeMap.get(attribute.getName()); PrometheusMetric metric = processBeanValue(toSnakeAndLowerCase(beanName.getDomain()), toSnakeAndLowerCase(attributeInfo.getName()), attributeInfo.getDescription(), attribute.getValue(), getKeyPropertyList(keyPropertiesPerBean, beanName)); if (metric != null) { metrics.add(metric); } } return metrics; } catch (ReflectionException | IntrospectionException | InstanceNotFoundException e) { LOGGER.error("Error in scraping bean - " + beanName.toString(), e); } return Collections.emptyList(); }
Source:
public XWikiAttachment set(XWikiAttachment attachment) { XWikiAttachment ret = map.put(attachment.getFilename(), attachment); this.list = new ArrayList<XWikiAttachment>(map.values()); added(ret); onUpdate(); return ret; }

Target:
public XWikiAttachment set(XWikiAttachment attachment) { XWikiAttachment put = map.put(attachment.getFilename(), attachment); if (put != attachment) { added(attachment); updatedMap(); } return put; }
Source:
protected DatastaxCassandraOrganisationStore(Session session, ConsistencyLevel writeConsistency, ConsistencyLevel readConsistency) { this.session = checkNotNull(session); this.readConsistency = checkNotNull(readConsistency); this.serializer = new OrganisationSerializer(); this.writeConsistency = checkNotNull(writeConsistency); RegularStatement statement = select().all() .from(ORGANISATION_TABLE) .where(in(PRIMARY_KEY_COLUMN, bindMarker("keys"))); statement.setFetchSize(Integer.MAX_VALUE); selectStatement = session.prepare(statement); rowUpdate = session.prepare(update(ORGANISATION_TABLE) .where(eq(PRIMARY_KEY_COLUMN, bindMarker("organisationId"))) .with(set(DATA_COLUMN, bindMarker("data")))) .setConsistencyLevel(writeConsistency); }

Target:
protected DatastaxCassandraOrganisationStore(Session session, ConsistencyLevel writeConsistency, ConsistencyLevel readConsistency) { this.session = checkNotNull(session); this.readConsistency = checkNotNull(readConsistency); this.serializer = new OrganisationSerializer(); this.writeConsistency = checkNotNull(writeConsistency); RegularStatement statement = select().all() .from(ORGANISATION_TABLE) .where(in(PRIMARY_KEY_COLUMN, bindMarker(KEYS))); statement.setFetchSize(Integer.MAX_VALUE); selectStatement = session.prepare(statement); rowUpdate = session.prepare(update(ORGANISATION_TABLE) .where(eq(PRIMARY_KEY_COLUMN, bindMarker(ORGANISATION_ID))) .with(set(DATA_COLUMN, bindMarker(DATA)))) .setConsistencyLevel(writeConsistency); }
Source:
public void close() throws IOException { for (OperationController oc : ocList) { oc.close(); } }

Target:
public void close() { if (isOpen.compareAndSet(true, false)) { logger.info("Closing down the router"); for (OperationController oc : ocList) { oc.shutdown(); } } }
Source:
private void handleBinderVariables(KItem kItem, boolean add) { if (!(kItem.kLabel() instanceof KLabel) || !(kItem.kList() instanceof KList)) { return; } assert kItem.kLabel() instanceof KLabel : "KLabel variables are not supported"; assert kItem.kList() instanceof KList : "KList must be concrete"; KLabel kLabel = (KLabel) kItem.kLabel(); KList kList = (KList) kItem.kList(); if (kLabel instanceof KLabelConstant) { KLabelConstant kLabelConstant = (KLabelConstant) kLabel; if (kLabelConstant.isBinder()) { Multimap<Integer, Integer> binderMap = kLabelConstant.getBinderMap(); for (Integer keyIndex : binderMap.keySet()) { if (add) { boundVariables.add(kList.get(keyIndex)); } else { boundVariables.remove(kList.get(keyIndex)); } } } } }

Target:
private void handleBinderVariables(KItem kItem, boolean add) { if (!(kItem.kLabel() instanceof KLabel) || !(kItem.kList() instanceof KList)) { return; } KLabel kLabel = (KLabel) kItem.kLabel(); KList kList = (KList) kItem.kList(); if (kLabel instanceof KLabelConstant) { KLabelConstant kLabelConstant = (KLabelConstant) kLabel; if (kLabelConstant.isBinder()) { Multimap<Integer, Integer> binderMap = kLabelConstant.getBinderMap(); for (Integer keyIndex : binderMap.keySet()) { if (add) { boundVariables.add(kList.get(keyIndex)); } else { boundVariables.remove(kList.get(keyIndex)); } } } } }
Source:
public void testServiceAnnouncement() throws Exception { curator.start(); List<String> serviceNames = ImmutableList.of( "druid/overlord", "druid/coordinator", "druid/firehose/tranquility_test-50-0000-0000" ); final ServiceDiscovery serviceDiscovery = createAndAnnounceServices(serviceNames); Assert.assertTrue( Iterators.all( serviceNames.iterator(), new Predicate<String>() { @Override public boolean apply(String input) { try { return serviceDiscovery.queryForInstances(input.replaceAll("/", ":")).size() == 1; } catch (Exception e) { e.printStackTrace(); throw new ISE( "Something went wrong while finding instance with name [%s] in Service Discovery", input ); } } } ) ); }

Target:
public void testServiceAnnouncement() throws Exception { curator.start(); List<String> serviceNames = ImmutableList.of( "druid/overlord", "druid/coordinator", "druid/firehose/tranquility_test-50-0000-0000" ); final ServiceDiscovery serviceDiscovery = createAndAnnounceServices(serviceNames); Assert.assertTrue( Iterators.all( serviceNames.iterator(), new Predicate<String>() { @Override public boolean apply(String input) { try { return serviceDiscovery.queryForInstances(input.replaceAll("/", ":")).size() == 1; } catch (Exception e) { throw new ISE( "Something went wrong while finding instance with name [%s] in Service Discovery", input ); } } } ) ); }
Source:
public List<T> getPossible(MediaType accept, Class<?> type) { List<T> cached = null; CachedMediaTypeAndClass cacheEntry = null; if (useCache) { cacheEntry = new CachedMediaTypeAndClass(type, accept); if (classCache != null) { cached = classCache.get(cacheEntry); if (cached != null) return cached; } } accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters()); List<Entry<T>> matches = new ArrayList<Entry<T>>(); if (accept.isWildcardType()) { matches.addAll(everything); } else { SubtypeMap<T> indexed = index.get(accept.getType()); if (indexed != null) { matches.addAll(indexed.getPossible(accept)); } matches.addAll(wildcards); } Collections.sort(matches, new TypedEntryComparator(type)); cached = convert(matches); if (useCache) { Map<CachedMediaTypeAndClass, List<T>> cache = classCache; if (cache == null) { synchronized (this) { if (classCache == null) { classCache = new ConcurrentHashMap<>(); } cache = classCache; } } cache.put(cacheEntry, cached); } return cached; }

Target:
public List<T> getPossible(MediaType accept, Class<?> type) { List<T> cached = null; CachedMediaTypeAndClass cacheEntry = null; if (useCache) { cacheEntry = new CachedMediaTypeAndClass(type, accept); if (classCache != null) { cached = classCache.get(cacheEntry); if (cached != null) return cached; } } accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters()); List<Entry<T>> matches = new ArrayList<Entry<T>>(); if (accept.isWildcardType()) { matches.addAll(everything); } else { SubtypeMap<T> indexed = index.get(accept.getType()); if (indexed != null) { matches.addAll(indexed.getPossible(accept)); } matches.addAll(wildcards); } Collections.sort(matches, new TypedEntryComparator(type)); cached = convert(matches); if (useCache) { Map<CachedMediaTypeAndClass, List<T>> cache = classCache; if (cache == null) { synchronized (this) { if (classCache == null) { classCache = new HashMap<>(); } cache = classCache; } } cache.put(cacheEntry, cached); } return cached; }
Source:
default void setEnterMessage(@Nullable Text message) { setEnterMessage(message, null); }

Target:
default void setEnterMessage(@Nullable Text message) { setEnterMessage(message, ChatTypes.CHAT); }
Source:
public OkCancelShell(String text) { super(ShellLookup.getInstance().getShell(text)); }

Target:
public OkCancelShell(String text) { super(text); }
Source:
public SyncPoller<OperationResult, CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainModelOptions trainModelOptions, Duration pollInterval) { return client.beginTraining(trainingFilesUrl, useTrainingLabels, null, pollInterval).getSyncPoller(); }

Target:
public SyncPoller<OperationResult, CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainModelOptions trainModelOptions, Duration pollInterval) { return client.beginTraining(trainingFilesUrl, useTrainingLabels, trainModelOptions, pollInterval) .getSyncPoller(); }
Source:
private OvfDataUpdater(){ SchedulerUtil scheduler = SchedulerUtilQuartzImpl.getInstance(); scheduler.scheduleAFixedDelayJob(this, "ovfUpdate_timer", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.OvfUpdateIntervalInMinutes), Config.<Integer> GetValue(ConfigValues.OvfUpdateIntervalInMinutes), TimeUnit.SECONDS); }

Target:
private OvfDataUpdater(){ vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(ITEMS_COUNT_PER_UPDATE); proccessedIdsInfo = new ArrayList<Guid>(); proccessedOvfGenerationsInfo = new ArrayList<Long>(); ovfManager = new OvfManager(); }
Source:
public SelectorBuilder builder() { return null; }

Target:
public SelectorBuilder builder() { SelectorBuilder builder = Selectors.builder(getType()); builder.add(getArguments()); return builder; }
Source:
public static EvaluationView toView(Evaluation evaluation) { EvaluationView evaluationView = new EvaluationView(); try { BeanUtils.copyProperties(evaluationView, evaluation); } catch (IllegalAccessException | InvocationTargetException ex) { throw new OpenStorefrontRuntimeException(ex); } Service service = ServiceProxyFactory.getServiceProxy(); evaluationView.setComponentName(service.getComponentService().getComponentName(evaluation.getComponentId())); if (StringUtils.isBlank(evaluationView.getComponentName())) { evaluationView.setComponentName(service.getComponentService().getComponentName(evaluation.getOriginComponentId())); } evaluationView.setWorkflowStatusDescription(TranslateUtil.translate(WorkflowStatus.class, evaluation.getWorkflowStatus())); ComponentIntegrationConfig integrationExample = new ComponentIntegrationConfig(); integrationExample.setActiveStatus(ACTIVE_STATUS); integrationExample.setComponentId(evaluation.getOriginComponentId()); ComponentIntegrationConfig integration = integrationExample.find(); if(integration != null && integration.getIntegrationType().equals("JIRA")) { evaluationView.setIssueNumber(integration.getIssueNumber()); String url = MessageFormat.format("{0}/browse/{1}", PropertiesManager.getInstance().getValue("jira.server.url"),integration.getIssueNumber()); evaluationView.setIntegrationUrl(url); } return evaluationView; }

Target:
public static EvaluationView toView(Evaluation evaluation) { return toView(evaluation, new HashMap<>()); }
Source:
public LogServlet(Config cfg, Renderer renderer, Linkifier linkifier) { super(cfg, renderer); this.linkifier = checkNotNull(linkifier, "linkifier"); String tn = cfg.getString("gitiles", "template", "log"); this.template_name = (tn == null) ? "gitiles.logDetail" : tn; }

Target:
public LogServlet(Config cfg, Renderer renderer, Linkifier linkifier) { super(cfg, renderer); this.linkifier = checkNotNull(linkifier, "linkifier"); String tn = cfg.getString("gitiles", null, "logTemplate"); this.template_name = (tn == null) ? "gitiles.logDetail" : tn; }
Source:
public void explicitCastReturnValueParentToChild() throws Throwable { MethodHandle mh = explicitCastReturnValueFromIdentity(Parent.class, Child.class); try { Child c = (Child) mh.invokeExact(new Parent()); } catch (ClassCastException expected) { } }

Target:
public void explicitCastReturnValueParentToChild() throws Throwable { MethodHandle mh = explicitCastReturnValueFromIdentity(Parent.class, Child.class); try { Child c = (Child) mh.invokeExact(new Parent()); fail("Expected CCE"); } catch (ClassCastException expected) }
Source:
public void testContainerWithHostConfig() throws Exception { assumeTrue("Docker API should be at least v1.18 to support Container Creation with " + "HostConfig, got " + sut.version().apiVersion(), versionCompare(sut.version().apiVersion(), "1.18") >= 0); sut.pull(BUSYBOX_LATEST); final boolean privileged = true; final boolean publishAllPorts = true; final String dns = "1.2.3.4"; final HostConfig expected = HostConfig.builder() .privileged(privileged) .publishAllPorts(publishAllPorts) .dns(dns) .cpuShares((long) 4096) .cpuQuota((long) 50000) .build(); final ContainerConfig config = ContainerConfig.builder() .image(BUSYBOX_LATEST) .hostConfig(expected) .build(); final String name = randomName(); final ContainerCreation creation = sut.createContainer(config, name); final String id = creation.id(); sut.startContainer(id); final HostConfig actual = sut.inspectContainer(id).hostConfig(); assertThat(actual.privileged(), equalTo(expected.privileged())); assertThat(actual.publishAllPorts(), equalTo(expected.publishAllPorts())); assertThat(actual.dns(), equalTo(expected.dns())); }

Target:
public void testContainerWithHostConfig() throws Exception { assumeTrue("Docker API should be at least v1.18 to support Container Creation with " + "HostConfig, got " + sut.version().apiVersion(), versionCompare(sut.version().apiVersion(), "1.18") >= 0); sut.pull(BUSYBOX_LATEST); final boolean privileged = true; final boolean publishAllPorts = true; final String dns = "1.2.3.4"; final HostConfig expected = HostConfig.builder() .privileged(privileged) .publishAllPorts(publishAllPorts) .dns(dns) .cpuShares((long) 4096) .build(); final ContainerConfig config = ContainerConfig.builder() .image(BUSYBOX_LATEST) .hostConfig(expected) .build(); final String name = randomName(); final ContainerCreation creation = sut.createContainer(config, name); final String id = creation.id(); sut.startContainer(id); final HostConfig actual = sut.inspectContainer(id).hostConfig(); assertThat(actual.privileged(), equalTo(expected.privileged())); assertThat(actual.publishAllPorts(), equalTo(expected.publishAllPorts())); assertThat(actual.dns(), equalTo(expected.dns())); assertThat(actual.cpuShares(), equalTo(expected.cpuShares())); }
Source:
private static void validatePrincipalParameter(Method method) { Parameter[] parameters = method.getParameters(); if (!isAuth(method)) { for (Parameter parameter : parameters) { if (parameter.isAnnotationPresent(Principal.class)) { throw new UnsupportedOperationException( "@Principal can be used only for parameter of @Auth method"); } } } if (method.getParameterCount() == 2) { if (parameters[0].isAnnotationPresent(Principal.class)) { throw new UnsupportedOperationException( "@Principal cannot be the first parameter if parameters count equals 2"); } if (!parameters[1].isAnnotationPresent(Principal.class)) { throw new UnsupportedOperationException( "The second parameter can be only @Principal (optional)"); } } }

Target:
private static void validatePrincipalParameter(Method method) { Parameter[] parameters = method.getParameters(); if (!isAuth(method)) { for (Parameter parameter : parameters) { if (parameter.isAnnotationPresent(Principal.class)) { throw new UnsupportedOperationException( "@Principal can be used only for parameter of @Auth method"); } } } if (method.getParameterCount() == 2) { if (parameters[0].isAnnotationPresent(Principal.class)) { throw new UnsupportedOperationException( "@Principal cannot be the first parameter on method with two parameters"); } if (!parameters[1].isAnnotationPresent(Principal.class)) { throw new UnsupportedOperationException( "The second parameter can be only @Principal (optional)"); } } }
Source:
public Object createWidget(final MUIElement element, Object parent) { if (!(element instanceof MPart) || !(parent instanceof Composite)) { return null; } final MPart part = (MPart) element; IEclipseContext localContext = part.getContext(); Widget parentWidget = (Widget) parent; Composite partComposite = localContext.get(Composite.class); if (partComposite == null) { final Composite newComposite = new Composite((Composite) parentWidget, SWT.NONE) { private boolean beingFocused = false; @Override public boolean setFocus() { if (!beingFocused) { try { beingFocused = true; Object object = part.getObject(); if (object != null && isEnabled()) { IPresentationEngine pe = part.getContext().get(IPresentationEngine.class); pe.focusGui(part); return true; } return super.setFocus(); } finally { beingFocused = false; } } return true; } }; newComposite.setLayout(new FillLayout(SWT.VERTICAL)); partComposite = newComposite; } bindWidget(element, partComposite); localContext.set(Composite.class, partComposite); IContributionFactory contributionFactory = localContext.get(IContributionFactory.class); Object newPart = contributionFactory.create(part.getContributionURI(), localContext); part.setObject(newPart); return partComposite; }

Target:
public Object createWidget(final MUIElement element, Object parent) { if (!(element instanceof MPart) || !(parent instanceof Composite)) { return null; } final MPart part = (MPart) element; IEclipseContext localContext = part.getContext(); Widget parentWidget = (Widget) parent; Composite partComposite = localContext.getLocal(Composite.class); if (partComposite == null) { final Composite newComposite = new Composite((Composite) parentWidget, SWT.NONE) { private boolean beingFocused = false; @Override public boolean setFocus() { if (!beingFocused) { try { beingFocused = true; Object object = part.getObject(); if (object != null && isEnabled()) { IPresentationEngine pe = part.getContext().get(IPresentationEngine.class); pe.focusGui(part); return true; } return super.setFocus(); } finally { beingFocused = false; } } return true; } }; newComposite.setLayout(new FillLayout(SWT.VERTICAL)); partComposite = newComposite; } bindWidget(element, partComposite); localContext.set(Composite.class, partComposite); IContributionFactory contributionFactory = localContext.get(IContributionFactory.class); Object newPart = contributionFactory.create(part.getContributionURI(), localContext); part.setObject(newPart); return partComposite; }
Source:
public void registerTransformers(SubsystemTransformerRegistration registration) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(registration.getCurrentSubsystemVersion()); buildTransformers_3_0(chainedBuilder.createBuilder(VERSION_3_0, VERSION_2_0)); buildTransformers_2_0(chainedBuilder.createBuilder(VERSION_2_0, VERSION_1_0)); chainedBuilder.buildAndRegister(registration, new ModelVersion[]{ VERSION_3_0, VERSION_2_0 }); }

Target:
public void registerTransformers(SubsystemTransformerRegistration registration) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(registration.getCurrentSubsystemVersion()); buildTransformers_2_0(chainedBuilder.createBuilder(registration.getCurrentSubsystemVersion(), VERSION_2_0)); chainedBuilder.buildAndRegister(registration, new ModelVersion[]{VERSION_2_0}); }
Source:
private static void checkAddress(long address, long offset) { if (!trace) return; Long blockSize = allocatedBlocks.get(address); if (blockSize == null || blockSize < offset) { throw new IllegalArgumentException(String.format("Trying to access address 0x%016x+%d, but blockSize was %s", address, offset, blockSize)); } }

Target:
private static void checkAddress(long address, long offset) { if (!trace) return; Long blockSize = allocatedBlocks.get(address); if (blockSize == null || blockSize < offset) { throw new IllegalArgumentException(String.format("Trying to access address 0x%016x+%d, but blockSize was %d", address, offset, blockSize)); } }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.signup_bottom_sheet_dialog, container, false); Button termsOfServiceText = layout.findViewById(R.id.signup_tos); termsOfServiceText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mSignupSheetListener.onSignupSheetTermsOfServiceClicked(); } }); termsOfServiceText.setText(Html.fromHtml(String.format( getDialog() .getContext() .getResources() .getString(R.string.signup_terms_of_service_text), "<u>", "</u>"))); Button signupWithEmailButton = layout.findViewById(R.id.signup_email); signupWithEmailButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mSignupSheetListener.onSignupSheetEmailClicked(); } }); Button signupWithGoogleButton = layout.findViewById(R.id.signup_google); signupWithGoogleButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mSignupSheetListener.onSignupSheetGoogleClicked(); } }); Dialog dialog = getDialog(); if (dialog != null) { dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { mSignupSheetListener.onSignupSheetCanceled(); } }); dialog.setContentView(layout); final BottomSheetBehavior behavior = BottomSheetBehavior.from((View) layout.getParent()); dialog.setOnShowListener(new OnShowListener() { @Override public void onShow(DialogInterface dialog) { behavior.setPeekHeight(layout.getHeight()); } }); } return super.onCreateView(inflater, container, savedInstanceState); }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.signup_bottom_sheet_dialog, container); }
Source:
protected boolean extractGuide(long guideTime) { int defaultStationID = Long.toString(providerID).hashCode(); if (defaultStationID > 0) defaultStationID *= -1; boolean[] didAdd = new boolean[1]; MMC mmc = MMC.getInstance(); CaptureDeviceInput cdi = mmc.getInputForProvider(providerID); if (cdi == null) return true; if (cdi.getType() == CaptureDeviceInput.DIGITAL_TUNER_CROSSBAR_INDEX) { EPG.getInstance().setLineup(providerID, new java.util.HashMap<Integer, String[]>()); EPG.getInstance().setServiceLevels(providerID, new java.util.HashMap<Long, Integer>()); return true; } int minChan = cdi.getMinChannel(); int maxChan = cdi.getMaxChannel(); if ((cdi.getType() != 1 || cdi.weirdRF()) && Sage.getBoolean("epg/dont_create_full_channel_list_for_non_tuner_inputs", true)) { maxChan = minChan; } java.util.HashMap<Integer, String[]> lineMap = new java.util.HashMap<Integer, String[]>(); for (int i = minChan; i <= maxChan; i++) { wiz.addChannel(cdi.getCrossName(), name, null, defaultStationID + i, 0, didAdd); if (didAdd[0]) wiz.resetAirings(defaultStationID + i); lineMap.put(new Integer(defaultStationID + i), new String[] { Integer.toString(i) }); } EPG.getInstance().setLineup(providerID, lineMap); EPG.getInstance().setServiceLevels(providerID, new java.util.HashMap<Long, Integer>()); return true; }

Target:
protected boolean extractGuide(long guideTime) { int defaultStationID = Long.toString(providerID).hashCode(); if (defaultStationID > 0) defaultStationID *= -1; boolean[] didAdd = new boolean[1]; MMC mmc = MMC.getInstance(); CaptureDeviceInput cdi = mmc.getInputForProvider(providerID); if (cdi == null) return true; if (cdi.getType() == CaptureDeviceInput.DIGITAL_TUNER_CROSSBAR_INDEX) { EPG.getInstance().setLineup(providerID, new java.util.HashMap<Integer, String[]>()); EPG.getInstance().setServiceLevels(providerID, new java.util.HashMap<Integer, Integer>()); return true; } int minChan = cdi.getMinChannel(); int maxChan = cdi.getMaxChannel(); if ((cdi.getType() != 1 || cdi.weirdRF()) && Sage.getBoolean("epg/dont_create_full_channel_list_for_non_tuner_inputs", true)) { maxChan = minChan; } java.util.HashMap<Integer, String[]> lineMap = new java.util.HashMap<Integer, String[]>(); for (int i = minChan; i <= maxChan; i++) { wiz.addChannel(cdi.getCrossName(), name, null, defaultStationID + i, 0, didAdd); if (didAdd[0]) wiz.resetAirings(defaultStationID + i); lineMap.put(new Integer(defaultStationID + i), new String[] { Integer.toString(i) }); } EPG.getInstance().setLineup(providerID, lineMap); EPG.getInstance().setServiceLevels(providerID, new java.util.HashMap<Integer, Integer>()); return true; }
Source:
private static Area offsetIntersection(final ObsContext ctx, final Set<Offset> offsets) { final double t = ctx.getPositionAngle().toRadians(); return offsets.stream().map(pos -> { final double p = pos.p().toArcsecs().getMagnitude(); final double q = pos.q().toArcsecs().getMagnitude(); final AffineTransform xform = new AffineTransform(); if (t != 0.0) xform.rotate(-t); xform.translate(-p, -q); return patrolField.getArea().createTransformedArea(xform); }).reduce(patrolField.getArea(), (a1, a2) -> { a1.intersect(a2); return a1; }); }

Target:
private static Area offsetIntersection(final ObsContext ctx, final Set<Offset> offsets) { final edu.gemini.spModel.core.Angle pa = ctx.getPositionAngle(); return offsets.stream().map(pos -> { final double p = pos.p().toArcsecs().getMagnitude(); final double q = pos.q().toArcsecs().getMagnitude(); final AffineTransform xform = new AffineTransform(); if (!pa.equals(Angle$.MODULE$.zero())) xform.rotate(-pa.toRadians()); xform.translate(-p, -q); return patrolField.getArea().createTransformedArea(xform); }).reduce((a1, a2) -> { final Area result = (Area) a1.clone(); result.intersect(a2); return result; }).orElse(patrolField.getArea()); }
Source:
protected String createHttpRequestURL() { String bugUrl = getUrlSuffix(); if (bugUrl.length() > 0 && authenticationRequired) { RepositoryLocation location = getClient().getLocation(); if (Boolean.parseBoolean(location.getProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY))) { bugUrl += MessageFormat.format("{1}Bugzilla_api_key={0}", new Object[] { location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY), bugUrl.endsWith("?") ? "" : "&" }); } else { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } UserCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } bugUrl += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } } return baseUrl() + bugUrl; }

Target:
protected String createHttpRequestURL() { String bugUrl = getUrlSuffix(); if (bugUrl.length() > 0 && authenticationRequired) { RepositoryLocation location = getClient().getLocation(); if (location.getBooleanPropery(IBugzillaRestConstants.REPOSITORY_USE_API_KEY)) { bugUrl += MessageFormat.format("{1}Bugzilla_api_key={0}", new Object[] { location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY), bugUrl.endsWith("?") ? "" : "&" }); } else { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } UserCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } bugUrl += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } } return baseUrl() + bugUrl; }
Source:
protected void resetAggregatesComputed() { super.resetAggregatesComputed(); if (weekActivity != null) { weekActivity.resetAggregatesComputed(); } }

Target:
protected void resetAggregatesComputed() { super.resetAggregatesComputed(); if (weekActivity == null) { return; } weekActivity.resetAggregatesComputed(); }
Source:
private InetAddress getBindAddress() { RuntimeContext context = getRuntimeContext(); Preconditions.checkState( context instanceof StreamingRuntimeContext, "CollectSinkFunction can only be used in StreamTask"); StreamingRuntimeContext streamingContext = (StreamingRuntimeContext) context; String bindHost = streamingContext .getTaskManagerRuntimeInfo() .getConfiguration() .getString(TaskManagerOptions.BIND_HOST); if (bindHost != null) { try { return InetAddress.getByName(bindHost); } catch (UnknownHostException e) { return null; } } return null; }

Target:
private InetAddress getBindAddress() { RuntimeContext context = getRuntimeContext(); Preconditions.checkState( context instanceof StreamingRuntimeContext, "CollectSinkFunction can only be used in StreamTask"); StreamingRuntimeContext streamingContext = (StreamingRuntimeContext) context; String bindAddress = streamingContext.getTaskManagerRuntimeInfo().getTaskManagerBindAddress(); if (bindAddress != null) { try { return InetAddress.getByName(bindAddress); } catch (UnknownHostException e) { return null; } } return null; }
Source:
public void initMetaData(ResourceIndex resIndex){ for(Map.Entry<String,String> entry : applicationMetaData.entrySet()){ if(entry.getValue().startsWith("@")){ Integer resId = ResName.getResourceId(resIndex, entry.getValue(), packageName); if(resId != null) entry.setValue(resId.toString()); } } for(ReceiverAndIntentFilter receiver : receivers){ for(Map.Entry<String,String> entry : receiver.metaData.entrySet()){ if(entry.getValue().startsWith("@")){ Integer resId = ResName.getResourceId(resIndex, entry.getValue(), packageName); if(resId != null) entry.setValue(resId.toString()); } } } }

Target:
public void initMetaData(ResourceIndex resIndex) { for (Map.Entry<String,String> entry : applicationMetaData.entrySet()) { if (entry.getValue().startsWith("@")) { Integer resId = ResName.getResourceId(resIndex, entry.getValue(), packageName); if (resId != null) { entry.setValue(resId.toString()); } } } for (ReceiverAndIntentFilter receiver : receivers) { for (Map.Entry<String,String> entry : receiver.metaData.entrySet()) { if (entry.getValue().startsWith("@")) { Integer resId = ResName.getResourceId(resIndex, entry.getValue(), packageName); if (resId != null) { entry.setValue(resId.toString()); } } } } }
Source:
public void validate(ValidationContext validationContext) { super.validate(validationContext); this.validateUniquenessOfId(validationContext); this.validateRepoIsSet(); this.validateMaterial(validationContext); if (isValidMaterial()) { this.validateAutoUpdateState(validationContext); this.validateMaterialUniqueness(validationContext); } }

Target:
public void validate(ValidationContext validationContext) { super.validate(validationContext); this.validateUniquenessOfId(validationContext); this.validateRepoIsSet(); this.validateMaterial(validationContext); if (isValidMaterial()) { this.validateAutoUpdateIsConsistentAmongSimilarMaterials(validationContext); this.validateMaterialUniqueness(validationContext); } }