Getting the modified collation elements taking into account the collation
attributes.

@param sourcece
@return the modified collation element
978607
private int getCE(int sourcece) {
        // note for tertiary we can't use the collator->tertiaryMask, that
        // is a preprocessed mask that takes into account case options. since
        // we are only concerned with exact matches, we don't need that.
        sourcece &= ceMask_;

        if (toShift_) {
            // alternate handling here, since only the 16 most significant digits
            // is only used, we can safely do a compare without masking
            // if the ce is a variable, we mask and get only the primary values
            // no shifting to quartenary is required since all primary values
            // less than variabletop will need to be masked off anyway.
            if (variableTop_ > sourcece) {
                if (strength_ >= Collator.QUATERNARY) {
                    sourcece &= PRIMARYORDERMASK;
                } else {
                    sourcece = CollationElementIterator.IGNORABLE;
                }
            }
        } else if (strength_ >= Collator.QUATERNARY && sourcece == CollationElementIterator.IGNORABLE) {
            sourcece = 0xFFFF;
        }

        return sourcece;
    }
462158
private static <T> Extension<T> parseBinderExtensionElement(Element element) {

        @SuppressWarnings("unchecked")
		Class<T> providerClass = (Class<T>)lookupClass(element.getAttribute("class"));
        
        Class<?> implementationClass = lookupClass(element.getAttribute("implementationClass"));

        if (providerClass == null) {
            throw new IllegalStateException("Referenced class {" + element.getAttribute("class")
                    + "} could not be found");
        }
        if (implementationClass == null) {
            throw new IllegalStateException("Referenced implementation class {" + element.getAttribute("implementationClass")
                    + "} could not be found");
        }
        if (providerClass.isAssignableFrom(implementationClass)) {
            throw new IllegalStateException("Referenced class {" + element.getAttribute("class")
                    + "} did not implement BindingProvider");
        }

		try {
			@SuppressWarnings("unchecked")
			final Class<? extends T> myImplementationClass = (Class<T>) implementationClass.newInstance();
			return new Extension<T>(providerClass, myImplementationClass);
		} catch (InstantiationException e) {
            throw new IllegalStateException("Referenced implementation class {" + element.getAttribute("implementationClass")
                    + "} could not be instantiated");
		} catch (IllegalAccessException e) {
            throw new IllegalStateException("Referenced implementation class {" + element.getAttribute("implementationClass")
                    + "} could not be accessed");
		}
    }
442423
@Nonnull
  public static ValidationSource createXMLSource (@Nonnull final IReadableResource aResource)
  {
    // Read on demand only
    return new ValidationSource (aResource.getPath (), () -> DOMReader.readXMLDOM (aResource), false)
    {
      @Override
      @Nonnull
      public Source getAsTransformSource ()
      {
        // Use resource as TransformSource to get error line and column
        return TransformSourceFactory.create (aResource);
      }
    };
  }
704622
def getSubstitutionElement(self, elt, ps):
        '''
        '''
        nsuri,ncname = _get_element_nsuri_name(elt)
        typecode = GED(nsuri,ncname)
        if typecode is None:
            return

        try:
            nsuri,ncname = typecode.substitutionGroup
        except (AttributeError, TypeError):
            return

        if (ncname == self.pname) and (nsuri == self.nspname or 
           (not nsuri and not self.nspname)):
             return typecode
       
        return
859372
static String sourceFormForInitializer(
      AnnotationValue annotationValue,
      ProcessingEnvironment processingEnv,
      String memberName,
      Element context) {
    SourceFormVisitor visitor =
        new InitializerSourceFormVisitor(processingEnv, memberName, context);
    StringBuilder sb = new StringBuilder();
    visitor.visit(annotationValue, sb);
    return sb.toString();
  }
350622
protected List<String> resolveScalacOptions( CompilerConfiguration configuration )
    {
        String scalacOptions = configuration.getScalacOptions();
        String sourceEncoding = configuration.getSourceEncoding();
        List<String> result = new ArrayList<String>( Arrays.asList( parseArgLine( scalacOptions ) ) );
        if ( !result.contains( "-encoding" ) && sourceEncoding != null && sourceEncoding.length() > 0 )
        {
            result.add( "-encoding" );
            result.add( sourceEncoding );
        }
        return result;
    }
689737
public void parseReplacedMethodSubElements(Element beanEle, MethodOverrides overrides) {
    NodeList nl = beanEle.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element && nodeNameEquals(node, REPLACED_METHOD_ELEMENT)) {
        Element replacedMethodEle = (Element) node;
        String name = replacedMethodEle.getAttribute(NAME_ATTRIBUTE);
        String callback = replacedMethodEle.getAttribute(REPLACER_ATTRIBUTE);
        ReplaceOverride replaceOverride = new ReplaceOverride(name, callback);
        // Look for arg-type match elements.
        List<Element> argTypeEles = DomUtils.getChildElementsByTagName(replacedMethodEle, ARG_TYPE_ELEMENT);
        for (Element argTypeEle : argTypeEles) {
          replaceOverride.addTypeIdentifier(argTypeEle.getAttribute(ARG_TYPE_MATCH_ATTRIBUTE));
        }
        replaceOverride.setSource(extractSource(replacedMethodEle));
        overrides.addOverride(replaceOverride);
      }
    }
  }
525029
public Template getTemplate(ISource source) {
		String cacheKey = source.getCacheKey();
		if (cacheKey == null) {	// cacheKey 为 null 则不缓存，详见 ISource.getCacheKey() 注释
			return buildTemplateBySource(source);
		}
		
		Template template = templateCache.get(cacheKey);
		if (template == null) {
			template = buildTemplateBySource(source);
			templateCache.put(cacheKey, template);
		} else if (devMode) {
			if (template.isModified()) {
				template = buildTemplateBySource(source);
				templateCache.put(cacheKey, template);
			}
		}
		return template;
	}
1208497
public static Currency getInstance(Locale locale) {
        synchronized (localesToCurrencies) {
            if (locale == null) {
                throw new NullPointerException("locale == null");
            }
            Currency currency = localesToCurrencies.get(locale);
            if (currency != null) {
                return currency;
            }

            String currencyCode = ICU.getCurrencyCode(locale);
            if (currencyCode == null) {
                throw new IllegalArgumentException("Unsupported ISO 3166 country: " + locale);
            } else if (currencyCode.equals("XXX")) {
                return null;
            }
            Currency result = getInstance(currencyCode);
            localesToCurrencies.put(locale, result);
            return result;
        }
    }
368621
public ImmutableListMultimap<Symbol, EDLMention> loadEDLMentionsByDocFrom(CharSource source) throws IOException {
    final ImmutableList<EDLMention> edlMentions = loadEDLMentionsFrom(source);
    final ImmutableListMultimap.Builder<Symbol, EDLMention> byDocs =
        ImmutableListMultimap.<Symbol, EDLMention>builder()
            .orderKeysBy(SymbolUtils.byStringOrdering());
    for (final EDLMention edlMention : edlMentions) {
      byDocs.put(edlMention.documentID(), edlMention);
    }
    return byDocs.build();
  }
703432
protected Locale ensureLocale(Locale locale) {

        // get the default locale for the resource
        List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(getCms(), getParamResource());
        if (m_content != null) {
            if (!m_content.hasLocale(locale)) {
                try {

                    // to copy anything we need at least one locale
                    if ((m_content.getLocales().size() > 0)) {
                        // required locale not available, check if an existing default locale should be copied as "template"
                        try {
                            // a list of possible default locales has been set as property, try to find a match
                            m_content.copyLocale(locales, locale);

                        } catch (CmsException e) {
                            m_content.addLocale(getCms(), locale);
                        }

                    } else {
                        m_content.addLocale(getCms(), locale);
                    }

                    writeContent();
                } catch (CmsException e) {
                    LOG.error(e.getMessageContainer(), e);
                }
            }
            if (!m_content.hasLocale(locale)) {
                // value may have changed because of the copy operation
                locale = m_content.getLocales().get(0);
            }
        }
        return locale;
    }
465869
protected Set<Element> getMembersFromJavaSource(final String clazzname, final ElementUtilities.ElementAcceptor acceptor) {
    final Set<Element> ret = new LinkedHashSet<>();
    JavaSource javaSource = getJavaSourceForClass(clazzname);
    if (javaSource != null) {
      try {
        javaSource.runUserActionTask(new Task<CompilationController>() {
          @Override
          public void run(CompilationController controller) throws IOException {
            controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
            TypeElement classElem = controller.getElements().getTypeElement(clazzname);
            if (classElem == null) {
              return;
            }
            ElementUtilities eu = controller.getElementUtilities();

            Iterable<? extends Element> members = eu.getMembers(classElem.asType(), acceptor);
            for (Element e : members) {
              ret.add(e);
            }
          }
        }, false);
      }
      catch (IOException ioe) {
        Exceptions.printStackTrace(ioe);
      }
    }
    return ret;
  }
319901
public Translation get(String locale) {
        locale = locale.replace("-", "_");
        Translation tr = translations.get(locale);
        if (locale.contains("_") && tr == null)
            tr = translations.get(locale.substring(0, 2));

        return tr;
    }
359207
public void adjustLocalesForElement(CmsResource elementResource) throws CmsException {

        if (m_copyMode != CopyMode.smartCopyAndChangeLocale) {
            return;
        }

        CmsFile file = m_cms.readFile(elementResource);
        Locale oldLocale = OpenCms.getLocaleManager().getDefaultLocale(m_cms, m_originalPage);
        Locale newLocale = OpenCms.getLocaleManager().getDefaultLocale(m_cms, m_targetFolder);
        CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
        try {
            content.moveLocale(oldLocale, newLocale);
            LOG.info("Replacing locale " + oldLocale + " -> " + newLocale + " for " + elementResource.getRootPath());
            file.setContents(content.marshal());
            m_cms.writeFile(file);
        } catch (CmsXmlException e) {
            LOG.info(
                "NOT replacing locale for "
                    + elementResource.getRootPath()
                    + ": old="
                    + oldLocale
                    + ", new="
                    + newLocale
                    + ", contentLocales="
                    + content.getLocales());
        }

    }
119312
public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
    {
        if (!isset($this->currentTranslations[$locale])) {
            if (null !== $this->collDealerContactInfoI18ns) {
                foreach ($this->collDealerContactInfoI18ns as $translation) {
                    if ($translation->getLocale() == $locale) {
                        $this->currentTranslations[$locale] = $translation;

                        return $translation;
                    }
                }
            }
            if ($this->isNew()) {
                $translation = new ChildDealerContactInfoI18n();
                $translation->setLocale($locale);
            } else {
                $translation = ChildDealerContactInfoI18nQuery::create()
                    ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
                    ->findOneOrCreate($con);
                $this->currentTranslations[$locale] = $translation;
            }
            $this->addDealerContactInfoI18n($translation);
        }

        return $this->currentTranslations[$locale];
    }
1181162
public static final String getLocaleExtendedName(String lookup, Locale locale) {

        if (locale == null) {
            return lookup;
        }
        return getLocaleExtendedName(lookup, locale.toString());
    }
788411
public String translate(final Case aCase) {
        String elseString = "";
        if (aCase.getFalseAction() != null) {
            inject(aCase.getFalseAction());
            elseString = String.format("ELSE %s", aCase.getFalseAction().translate());
        }

        final String whens = aCase.whens.stream()
                .peek(this::inject)
                .map(When::translate)
                .collect(Collectors.joining(" "));

        return String.format("CASE %s %s END",
                             whens,
                             elseString);
    }