repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/MethodArgumentsUberspector.java | MethodArgumentsUberspector.getPrivateMethod | private Method getPrivateMethod(VelMethod velMethod) throws Exception
{
Field methodField = velMethod.getClass().getDeclaredField("method");
boolean isAccessible = methodField.isAccessible();
try {
methodField.setAccessible(true);
return (Method) methodField.get(velMe... | java | private Method getPrivateMethod(VelMethod velMethod) throws Exception
{
Field methodField = velMethod.getClass().getDeclaredField("method");
boolean isAccessible = methodField.isAccessible();
try {
methodField.setAccessible(true);
return (Method) methodField.get(velMe... | [
"private",
"Method",
"getPrivateMethod",
"(",
"VelMethod",
"velMethod",
")",
"throws",
"Exception",
"{",
"Field",
"methodField",
"=",
"velMethod",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"\"method\"",
")",
";",
"boolean",
"isAccessible",
"=",
"m... | This is hackish but there's no way in Velocity to get access to the underlying Method from a VelMethod instance. | [
"This",
"is",
"hackish",
"but",
"there",
"s",
"no",
"way",
"in",
"Velocity",
"to",
"get",
"access",
"to",
"the",
"underlying",
"Method",
"from",
"a",
"VelMethod",
"instance",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/MethodArgumentsUberspector.java#L122-L132 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/MethodArgumentsUberspector.java | MethodArgumentsUberspector.convertArguments | private Object[] convertArguments(Object obj, String methodName, Object[] args)
{
for (Method method : obj.getClass().getMethods()) {
if (method.getName().equalsIgnoreCase(methodName)
&& (method.getGenericParameterTypes().length == args.length || method.isVarArgs())) {
... | java | private Object[] convertArguments(Object obj, String methodName, Object[] args)
{
for (Method method : obj.getClass().getMethods()) {
if (method.getName().equalsIgnoreCase(methodName)
&& (method.getGenericParameterTypes().length == args.length || method.isVarArgs())) {
... | [
"private",
"Object",
"[",
"]",
"convertArguments",
"(",
"Object",
"obj",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"obj",
".",
"getClass",
"(",
")",
".",
"getMethods",
"(",
")",
")",
... | Converts the given arguments to match a method with the specified name and the same number of formal parameters
as the number of arguments.
@param obj the object the method is invoked on, used to retrieve the list of available methods
@param methodName the method we're looking for
@param args the method arguments
@ret... | [
"Converts",
"the",
"given",
"arguments",
"to",
"match",
"a",
"method",
"with",
"the",
"specified",
"name",
"and",
"the",
"same",
"number",
"of",
"formal",
"parameters",
"as",
"the",
"number",
"of",
"arguments",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/MethodArgumentsUberspector.java#L144-L158 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/DefaultExtensionInitializer.java | DefaultExtensionInitializer.initializeExtension | private void initializeExtension(InstalledExtension installedExtension, String namespaceToLoad,
Map<String, Set<InstalledExtension>> initializedExtensions) throws ExtensionException
{
if (installedExtension.getNamespaces() != null) {
if (namespaceToLoad == null) {
for (St... | java | private void initializeExtension(InstalledExtension installedExtension, String namespaceToLoad,
Map<String, Set<InstalledExtension>> initializedExtensions) throws ExtensionException
{
if (installedExtension.getNamespaces() != null) {
if (namespaceToLoad == null) {
for (St... | [
"private",
"void",
"initializeExtension",
"(",
"InstalledExtension",
"installedExtension",
",",
"String",
"namespaceToLoad",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"InstalledExtension",
">",
">",
"initializedExtensions",
")",
"throws",
"ExtensionException",
"{",
... | Initialize extension.
@param installedExtension the extension to initialize
@param namespaceToLoad the namespace to be initialized, null for all
@param initializedExtensions the currently initialized extensions set
@throws ExtensionException when an initialization error occurs | [
"Initialize",
"extension",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/DefaultExtensionInitializer.java#L121-L135 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/DefaultExtensionInitializer.java | DefaultExtensionInitializer.initializeExtensionInNamespace | private void initializeExtensionInNamespace(InstalledExtension installedExtension, String namespace,
Map<String, Set<InstalledExtension>> initializedExtensions) throws ExtensionException
{
// Check if the extension can be available from this namespace
if (!installedExtension.isValid(namespac... | java | private void initializeExtensionInNamespace(InstalledExtension installedExtension, String namespace,
Map<String, Set<InstalledExtension>> initializedExtensions) throws ExtensionException
{
// Check if the extension can be available from this namespace
if (!installedExtension.isValid(namespac... | [
"private",
"void",
"initializeExtensionInNamespace",
"(",
"InstalledExtension",
"installedExtension",
",",
"String",
"namespace",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"InstalledExtension",
">",
">",
"initializedExtensions",
")",
"throws",
"ExtensionException",
"{... | Initialize an extension in the given namespace.
@param installedExtension the extension to initialize
@param namespace the namespace in which the extention is initialized, null for global
@param initializedExtensions the currently initialized extensions set (to avoid initializing twice a dependency)
@throws ExtensionE... | [
"Initialize",
"an",
"extension",
"in",
"the",
"given",
"namespace",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/DefaultExtensionInitializer.java#L145-L164 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/DeprecatedCheckUberspector.java | DeprecatedCheckUberspector.logWarning | private void logWarning(String deprecationType, Object object, String methodName, Info info)
{
this.log.warn(String.format("Deprecated usage of %s [%s] in %s@%d,%d", deprecationType, object.getClass()
.getCanonicalName() + "." + methodName, info.getTemplateName(), info.getLine(), info.getColumn(... | java | private void logWarning(String deprecationType, Object object, String methodName, Info info)
{
this.log.warn(String.format("Deprecated usage of %s [%s] in %s@%d,%d", deprecationType, object.getClass()
.getCanonicalName() + "." + methodName, info.getTemplateName(), info.getLine(), info.getColumn(... | [
"private",
"void",
"logWarning",
"(",
"String",
"deprecationType",
",",
"Object",
"object",
",",
"String",
"methodName",
",",
"Info",
"info",
")",
"{",
"this",
".",
"log",
".",
"warn",
"(",
"String",
".",
"format",
"(",
"\"Deprecated usage of %s [%s] in %s@%d,%d... | Helper method to log a warning when a deprecation has been found.
@param deprecationType the type of deprecation (eg "getter", "setter", "method")
@param object the object that has a deprecation
@param methodName the deprecated method's name
@param info a Velocity {@link org.apache.velocity.util.introspection.Info} ob... | [
"Helper",
"method",
"to",
"log",
"a",
"warning",
"when",
"a",
"deprecation",
"has",
"been",
"found",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/DeprecatedCheckUberspector.java#L112-L116 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java | DefaultBeanDescriptor.extractBeanDescriptor | protected void extractBeanDescriptor()
{
Object defaultInstance = null;
try {
defaultInstance = getBeanClass().newInstance();
} catch (Exception e) {
LOGGER.debug("Failed to create a new default instance for class " + this.beanClass
+ ". The BeanD... | java | protected void extractBeanDescriptor()
{
Object defaultInstance = null;
try {
defaultInstance = getBeanClass().newInstance();
} catch (Exception e) {
LOGGER.debug("Failed to create a new default instance for class " + this.beanClass
+ ". The BeanD... | [
"protected",
"void",
"extractBeanDescriptor",
"(",
")",
"{",
"Object",
"defaultInstance",
"=",
"null",
";",
"try",
"{",
"defaultInstance",
"=",
"getBeanClass",
"(",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOG... | Extract informations form the bean. | [
"Extract",
"informations",
"form",
"the",
"bean",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java#L96-L132 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java | DefaultBeanDescriptor.extractPropertyAnnotation | protected <T extends Annotation> T extractPropertyAnnotation(Method writeMethod, Method readMethod,
Class<T> annotationClass)
{
T parameterDescription = writeMethod.getAnnotation(annotationClass);
if (parameterDescription == null && readMethod != null) {
parameterDescription... | java | protected <T extends Annotation> T extractPropertyAnnotation(Method writeMethod, Method readMethod,
Class<T> annotationClass)
{
T parameterDescription = writeMethod.getAnnotation(annotationClass);
if (parameterDescription == null && readMethod != null) {
parameterDescription... | [
"protected",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"extractPropertyAnnotation",
"(",
"Method",
"writeMethod",
",",
"Method",
"readMethod",
",",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"T",
"parameterDescription",
"=",
"writeMethod",
".",
"get... | Get the parameter annotation. Try first on the setter then on the getter if no annotation has been found.
@param <T> the Class object corresponding to the annotation type.
@param writeMethod the method that should be used to write the property value.
@param readMethod the method that should be used to read the propert... | [
"Get",
"the",
"parameter",
"annotation",
".",
"Try",
"first",
"on",
"the",
"setter",
"then",
"on",
"the",
"getter",
"if",
"no",
"annotation",
"has",
"been",
"found",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java#L315-L325 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/main/java/org/xwiki/logging/LogTreeNode.java | LogTreeNode.size | public int size(boolean recurse)
{
if (!recurse) {
return this.children != null ? this.children.size() : 0;
}
int size = 0;
for (LogEvent logEvent : this) {
++size;
if (logEvent instanceof LogTreeNode) {
size += ((LogTreeNode) lo... | java | public int size(boolean recurse)
{
if (!recurse) {
return this.children != null ? this.children.size() : 0;
}
int size = 0;
for (LogEvent logEvent : this) {
++size;
if (logEvent instanceof LogTreeNode) {
size += ((LogTreeNode) lo... | [
"public",
"int",
"size",
"(",
"boolean",
"recurse",
")",
"{",
"if",
"(",
"!",
"recurse",
")",
"{",
"return",
"this",
".",
"children",
"!=",
"null",
"?",
"this",
".",
"children",
".",
"size",
"(",
")",
":",
"0",
";",
"}",
"int",
"size",
"=",
"0",
... | The number of logs.
@param recurse if true navigate through the whole tree, otherwise only the first level
@return the number of log events | [
"The",
"number",
"of",
"logs",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/main/java/org/xwiki/logging/LogTreeNode.java#L131-L148 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.getCertificateProvider | public static CertificateProvider getCertificateProvider(ComponentManager manager, Store store,
CertificateProvider certificateProvider) throws GeneralSecurityException
{
CertificateProvider provider = newCertificateProvider(manager, store);
if (certificateProvider == null) {
re... | java | public static CertificateProvider getCertificateProvider(ComponentManager manager, Store store,
CertificateProvider certificateProvider) throws GeneralSecurityException
{
CertificateProvider provider = newCertificateProvider(manager, store);
if (certificateProvider == null) {
re... | [
"public",
"static",
"CertificateProvider",
"getCertificateProvider",
"(",
"ComponentManager",
"manager",
",",
"Store",
"store",
",",
"CertificateProvider",
"certificateProvider",
")",
"throws",
"GeneralSecurityException",
"{",
"CertificateProvider",
"provider",
"=",
"newCerti... | Get a certificate provider for a given store and an additional certificate provider.
@param manager the component manager.
@param store the store to wrap.
@param certificateProvider provider of additional certificate to proceed to the verification.
@return a certificate provider wrapping the store.
@throws GeneralSecu... | [
"Get",
"a",
"certificate",
"provider",
"for",
"a",
"given",
"store",
"and",
"an",
"additional",
"certificate",
"provider",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L67-L77 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.addCertificatesToVerifiedData | public static void addCertificatesToVerifiedData(Store store, BcCMSSignedDataVerified verifiedData,
CertificateFactory certFactory)
{
for (X509CertificateHolder cert : getCertificates(store)) {
verifiedData.addCertificate(BcUtils.convertCertificate(certFactory, cert));
}
} | java | public static void addCertificatesToVerifiedData(Store store, BcCMSSignedDataVerified verifiedData,
CertificateFactory certFactory)
{
for (X509CertificateHolder cert : getCertificates(store)) {
verifiedData.addCertificate(BcUtils.convertCertificate(certFactory, cert));
}
} | [
"public",
"static",
"void",
"addCertificatesToVerifiedData",
"(",
"Store",
"store",
",",
"BcCMSSignedDataVerified",
"verifiedData",
",",
"CertificateFactory",
"certFactory",
")",
"{",
"for",
"(",
"X509CertificateHolder",
"cert",
":",
"getCertificates",
"(",
"store",
")"... | Add certificate from signed data to the verified signed data.
@param store the store containing the certificate to add.
@param verifiedData the verified signed data to be filled.
@param certFactory the certificate factory to use for certificate conversion. | [
"Add",
"certificate",
"from",
"signed",
"data",
"to",
"the",
"verified",
"signed",
"data",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L86-L92 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.getCertificateProvider | public static CertificateProvider getCertificateProvider(ComponentManager manager,
Collection<CertifiedPublicKey> certificates) throws GeneralSecurityException
{
if (certificates == null || certificates.isEmpty()) {
return null;
}
Collection<X509CertificateHolder> certs ... | java | public static CertificateProvider getCertificateProvider(ComponentManager manager,
Collection<CertifiedPublicKey> certificates) throws GeneralSecurityException
{
if (certificates == null || certificates.isEmpty()) {
return null;
}
Collection<X509CertificateHolder> certs ... | [
"public",
"static",
"CertificateProvider",
"getCertificateProvider",
"(",
"ComponentManager",
"manager",
",",
"Collection",
"<",
"CertifiedPublicKey",
">",
"certificates",
")",
"throws",
"GeneralSecurityException",
"{",
"if",
"(",
"certificates",
"==",
"null",
"||",
"ce... | Create a new store containing the given certificates and return it as a certificate provider.
@param manager the component manager.
@param certificates the certificates.
@return a certificate provider wrapping the collection of certificate.
@throws GeneralSecurityException if unable to initialize the provider. | [
"Create",
"a",
"new",
"store",
"containing",
"the",
"given",
"certificates",
"and",
"return",
"it",
"as",
"a",
"certificate",
"provider",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L102-L116 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.newCertificateProvider | private static CertificateProvider newCertificateProvider(ComponentManager manager, Store store)
throws GeneralSecurityException
{
try {
CertificateProvider provider = manager.getInstance(CertificateProvider.class, "BCStoreX509");
((BcStoreX509CertificateProvider) provider).s... | java | private static CertificateProvider newCertificateProvider(ComponentManager manager, Store store)
throws GeneralSecurityException
{
try {
CertificateProvider provider = manager.getInstance(CertificateProvider.class, "BCStoreX509");
((BcStoreX509CertificateProvider) provider).s... | [
"private",
"static",
"CertificateProvider",
"newCertificateProvider",
"(",
"ComponentManager",
"manager",
",",
"Store",
"store",
")",
"throws",
"GeneralSecurityException",
"{",
"try",
"{",
"CertificateProvider",
"provider",
"=",
"manager",
".",
"getInstance",
"(",
"Cert... | Wrap a bouncy castle store into an adapter for the CertificateProvider interface.
@param manager the component manager.
@param store the store.
@return a certificate provider wrapping the store.
@throws GeneralSecurityException if unable to initialize the provider. | [
"Wrap",
"a",
"bouncy",
"castle",
"store",
"into",
"an",
"adapter",
"for",
"the",
"CertificateProvider",
"interface",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L126-L137 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.getCertificate | public static CertifiedPublicKey getCertificate(CertificateProvider provider, SignerInformation signer,
CertificateFactory factory)
{
SignerId id = signer.getSID();
if (provider instanceof BcStoreX509CertificateProvider) {
X509CertificateHolder cert = ((BcStoreX509CertificatePro... | java | public static CertifiedPublicKey getCertificate(CertificateProvider provider, SignerInformation signer,
CertificateFactory factory)
{
SignerId id = signer.getSID();
if (provider instanceof BcStoreX509CertificateProvider) {
X509CertificateHolder cert = ((BcStoreX509CertificatePro... | [
"public",
"static",
"CertifiedPublicKey",
"getCertificate",
"(",
"CertificateProvider",
"provider",
",",
"SignerInformation",
"signer",
",",
"CertificateFactory",
"factory",
")",
"{",
"SignerId",
"id",
"=",
"signer",
".",
"getSID",
"(",
")",
";",
"if",
"(",
"provi... | Retrieve the certificate matching the given signer from the certificate provider.
@param provider a certificate provider.
@param signer the signer for which you want to retrieve the certificate.
@param factory a certificate factory to convert the certificate.
@return a certified public key. | [
"Retrieve",
"the",
"certificate",
"matching",
"the",
"given",
"signer",
"from",
"the",
"certificate",
"provider",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L153-L180 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/VersionUtils.java | VersionUtils.getStrictVersion | public static Version getStrictVersion(Collection<? extends VersionRangeCollection> ranges)
{
for (VersionRangeCollection collection : ranges) {
if (collection.getRanges().size() == 1) {
VersionRange range = collection.getRanges().iterator().next();
if (range inst... | java | public static Version getStrictVersion(Collection<? extends VersionRangeCollection> ranges)
{
for (VersionRangeCollection collection : ranges) {
if (collection.getRanges().size() == 1) {
VersionRange range = collection.getRanges().iterator().next();
if (range inst... | [
"public",
"static",
"Version",
"getStrictVersion",
"(",
"Collection",
"<",
"?",
"extends",
"VersionRangeCollection",
">",
"ranges",
")",
"{",
"for",
"(",
"VersionRangeCollection",
"collection",
":",
"ranges",
")",
"{",
"if",
"(",
"collection",
".",
"getRanges",
... | Check if passed range collection is a strict version.
@param ranges the ranges to search into
@return the strict version constraint found or null if none could be found
@since 9.8RC1 | [
"Check",
"if",
"passed",
"range",
"collection",
"is",
"a",
"strict",
"version",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/VersionUtils.java#L71-L87 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java | DefaultJobProgressStep.addLevel | public DefaultJobProgressStep addLevel(int steps, Object newLevelSource, boolean levelStep)
{
assertModifiable();
this.maximumChildren = steps;
this.levelSource = newLevelSource;
if (steps > 0) {
this.childSize = 1.0D / steps;
}
if (this.maximumChildren... | java | public DefaultJobProgressStep addLevel(int steps, Object newLevelSource, boolean levelStep)
{
assertModifiable();
this.maximumChildren = steps;
this.levelSource = newLevelSource;
if (steps > 0) {
this.childSize = 1.0D / steps;
}
if (this.maximumChildren... | [
"public",
"DefaultJobProgressStep",
"addLevel",
"(",
"int",
"steps",
",",
"Object",
"newLevelSource",
",",
"boolean",
"levelStep",
")",
"{",
"assertModifiable",
"(",
")",
";",
"this",
".",
"maximumChildren",
"=",
"steps",
";",
"this",
".",
"levelSource",
"=",
... | Add children to the step and return the first one.
@param steps the number of step
@param newLevelSource who asked to create this new level
@param levelStep the new level can contains only one step
@return the new step | [
"Add",
"children",
"to",
"the",
"step",
"and",
"return",
"the",
"first",
"one",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java#L183-L204 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java | DefaultJobProgressStep.nextStep | public DefaultJobProgressStep nextStep(Message stepMessage, Object newStepSource)
{
assertModifiable();
// Close current step and move to the end
finishStep();
// Add new step
return addStep(stepMessage, newStepSource);
} | java | public DefaultJobProgressStep nextStep(Message stepMessage, Object newStepSource)
{
assertModifiable();
// Close current step and move to the end
finishStep();
// Add new step
return addStep(stepMessage, newStepSource);
} | [
"public",
"DefaultJobProgressStep",
"nextStep",
"(",
"Message",
"stepMessage",
",",
"Object",
"newStepSource",
")",
"{",
"assertModifiable",
"(",
")",
";",
"// Close current step and move to the end",
"finishStep",
"(",
")",
";",
"// Add new step",
"return",
"addStep",
... | Move to next child step.
@param stepMessage the message associated to the step
@param newStepSource who asked to create this new step
@return the new step | [
"Move",
"to",
"next",
"child",
"step",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java#L239-L248 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java | DefaultJobProgressStep.finishStep | public void finishStep()
{
// Close step
if (this.children != null && !this.children.isEmpty()) {
this.children.get(this.children.size() - 1).finish();
}
} | java | public void finishStep()
{
// Close step
if (this.children != null && !this.children.isEmpty()) {
this.children.get(this.children.size() - 1).finish();
}
} | [
"public",
"void",
"finishStep",
"(",
")",
"{",
"// Close step",
"if",
"(",
"this",
".",
"children",
"!=",
"null",
"&&",
"!",
"this",
".",
"children",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"children",
".",
"get",
"(",
"this",
".",
"children... | Finish current step. | [
"Finish",
"current",
"step",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java#L253-L259 | train |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/FormatMojo.java | FormatMojo.removeNodes | private void removeNodes(String xpathExpression, Document domdoc)
{
List<Node> nodes = domdoc.selectNodes(xpathExpression);
for (Node node : nodes) {
node.detach();
}
} | java | private void removeNodes(String xpathExpression, Document domdoc)
{
List<Node> nodes = domdoc.selectNodes(xpathExpression);
for (Node node : nodes) {
node.detach();
}
} | [
"private",
"void",
"removeNodes",
"(",
"String",
"xpathExpression",
",",
"Document",
"domdoc",
")",
"{",
"List",
"<",
"Node",
">",
"nodes",
"=",
"domdoc",
".",
"selectNodes",
"(",
"xpathExpression",
")",
";",
"for",
"(",
"Node",
"node",
":",
"nodes",
")",
... | Remove the nodes found with the xpath expression.
@param xpathExpression the xpath expression of the nodes
@param domdoc The DOM document | [
"Remove",
"the",
"nodes",
"found",
"with",
"the",
"xpath",
"expression",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/FormatMojo.java#L204-L210 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/AbstractExtension.java | AbstractExtension.get | @Override
public <T> T get(String fieldName)
{
switch (fieldName.toLowerCase()) {
case FIELD_REPOSITORY:
return (T) getRepository();
case FIELD_ID:
return (T) getId().getId();
case FIELD_VERSION:
return (T) getId().getVe... | java | @Override
public <T> T get(String fieldName)
{
switch (fieldName.toLowerCase()) {
case FIELD_REPOSITORY:
return (T) getRepository();
case FIELD_ID:
return (T) getId().getId();
case FIELD_VERSION:
return (T) getId().getVe... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"fieldName",
")",
"{",
"switch",
"(",
"fieldName",
".",
"toLowerCase",
"(",
")",
")",
"{",
"case",
"FIELD_REPOSITORY",
":",
"return",
"(",
"T",
")",
"getRepository",
"(",
")",
";",
... | Get an extension field by name. Fallback on properties.
@param fieldName the field name;
@return the field value or null if none could be found | [
"Get",
"an",
"extension",
"field",
"by",
"name",
".",
"Fallback",
"on",
"properties",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/AbstractExtension.java#L208-L257 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.extractXML | public static String extractXML(Node node, int start, int length)
{
ExtractHandler handler = null;
try {
handler = new ExtractHandler(start, length);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(new DOMSource(node), ne... | java | public static String extractXML(Node node, int start, int length)
{
ExtractHandler handler = null;
try {
handler = new ExtractHandler(start, length);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(new DOMSource(node), ne... | [
"public",
"static",
"String",
"extractXML",
"(",
"Node",
"node",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"ExtractHandler",
"handler",
"=",
"null",
";",
"try",
"{",
"handler",
"=",
"new",
"ExtractHandler",
"(",
"start",
",",
"length",
")",
";... | Extracts a well-formed XML fragment from the given DOM tree.
@param node the root of the DOM tree where the extraction takes place
@param start the index of the first character
@param length the maximum number of characters in text nodes to include in the returned fragment
@return a well-formed XML fragment starting a... | [
"Extracts",
"a",
"well",
"-",
"formed",
"XML",
"fragment",
"from",
"the",
"given",
"DOM",
"tree",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L137-L152 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.unescape | public static String unescape(Object content)
{
if (content == null) {
return null;
}
String str = String.valueOf(content);
str = APOS_PATTERN.matcher(str).replaceAll("'");
str = QUOT_PATTERN.matcher(str).replaceAll("\"");
str = LT_PATTERN.matcher(str).re... | java | public static String unescape(Object content)
{
if (content == null) {
return null;
}
String str = String.valueOf(content);
str = APOS_PATTERN.matcher(str).replaceAll("'");
str = QUOT_PATTERN.matcher(str).replaceAll("\"");
str = LT_PATTERN.matcher(str).re... | [
"public",
"static",
"String",
"unescape",
"(",
"Object",
"content",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"str",
"=",
"String",
".",
"valueOf",
"(",
"content",
")",
";",
"str",
"=",
"APOS_PATTERN"... | Unescape encoded special XML characters. Only >, < &, ", ' and { are unescaped, since they are the only
ones that affect the resulting markup.
@param content the text to decode, may be {@code null}
@return unescaped content, {@code null} if {@code null} input | [
"Unescape",
"encoded",
"special",
"XML",
"characters",
".",
"Only",
">",
";",
"<",
";",
"&",
";",
"and",
"{",
"are",
"unescaped",
"since",
"they",
"are",
"the",
"only",
"ones",
"that",
"affect",
"the",
"resulting",
"markup",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L319-L334 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.parse | public static Document parse(LSInput source)
{
try {
LSParser p = LS_IMPL.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
// Disable validation, since this takes a lot of time and causes unneeded network traffic
p.getDomConfig().setParameter("validate", false)... | java | public static Document parse(LSInput source)
{
try {
LSParser p = LS_IMPL.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
// Disable validation, since this takes a lot of time and causes unneeded network traffic
p.getDomConfig().setParameter("validate", false)... | [
"public",
"static",
"Document",
"parse",
"(",
"LSInput",
"source",
")",
"{",
"try",
"{",
"LSParser",
"p",
"=",
"LS_IMPL",
".",
"createLSParser",
"(",
"DOMImplementationLS",
".",
"MODE_SYNCHRONOUS",
",",
"null",
")",
";",
"// Disable validation, since this takes a lo... | Parse a DOM Document from a source.
@param source the source input to parse
@return the equivalent DOM Document, or {@code null} if the parsing failed. | [
"Parse",
"a",
"DOM",
"Document",
"from",
"a",
"source",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L357-L371 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.serialize | public static String serialize(Node node, boolean withXmlDeclaration)
{
if (node == null) {
return "";
}
try {
LSOutput output = LS_IMPL.createLSOutput();
StringWriter result = new StringWriter();
output.setCharacterStream(result);
... | java | public static String serialize(Node node, boolean withXmlDeclaration)
{
if (node == null) {
return "";
}
try {
LSOutput output = LS_IMPL.createLSOutput();
StringWriter result = new StringWriter();
output.setCharacterStream(result);
... | [
"public",
"static",
"String",
"serialize",
"(",
"Node",
"node",
",",
"boolean",
"withXmlDeclaration",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"LSOutput",
"output",
"=",
"LS_IMPL",
".",
"createLSOutput",
... | Serialize a DOM Node into a string, with an optional XML declaration at the start.
@param node the node to export
@param withXmlDeclaration whether to output the XML declaration or not
@return the serialized node, or an empty string if the serialization fails or the node is {@code null} | [
"Serialize",
"a",
"DOM",
"Node",
"into",
"a",
"string",
"with",
"an",
"optional",
"XML",
"declaration",
"at",
"the",
"start",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L391-L416 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.transform | public static String transform(Source xml, Source xslt)
{
if (xml != null && xslt != null) {
try {
StringWriter output = new StringWriter();
Result result = new StreamResult(output);
javax.xml.transform.TransformerFactory.newInstance().newTransform... | java | public static String transform(Source xml, Source xslt)
{
if (xml != null && xslt != null) {
try {
StringWriter output = new StringWriter();
Result result = new StreamResult(output);
javax.xml.transform.TransformerFactory.newInstance().newTransform... | [
"public",
"static",
"String",
"transform",
"(",
"Source",
"xml",
",",
"Source",
"xslt",
")",
"{",
"if",
"(",
"xml",
"!=",
"null",
"&&",
"xslt",
"!=",
"null",
")",
"{",
"try",
"{",
"StringWriter",
"output",
"=",
"new",
"StringWriter",
"(",
")",
";",
"... | Apply an XSLT transformation to a Document.
@param xml the document to transform
@param xslt the stylesheet to apply
@return the transformation result, or {@code null} if an error occurs or {@code null} xml or xslt input | [
"Apply",
"an",
"XSLT",
"transformation",
"to",
"a",
"Document",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L425-L438 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.formatXMLContent | public static String formatXMLContent(String content) throws TransformerFactoryConfigurationError,
TransformerException
{
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputPropert... | java | public static String formatXMLContent(String content) throws TransformerFactoryConfigurationError,
TransformerException
{
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputPropert... | [
"public",
"static",
"String",
"formatXMLContent",
"(",
"String",
"content",
")",
"throws",
"TransformerFactoryConfigurationError",
",",
"TransformerException",
"{",
"Transformer",
"transformer",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
".",
"newTransformer... | Parse and pretty print a XML content.
@param content the XML content to format
@return the formated version of the passed XML content
@throws TransformerFactoryConfigurationError when failing to create a
{@link TransformerFactoryConfigurationError}
@throws TransformerException when failing to transform the content
@si... | [
"Parse",
"and",
"pretty",
"print",
"a",
"XML",
"content",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L450-L483 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-context/src/main/java/org/xwiki/context/ExecutionContext.java | ExecutionContext.declareProperty | private void declareProperty(ExecutionContextProperty property)
{
if (this.properties.containsKey(property.getKey())) {
throw new PropertyAlreadyExistsException(property.getKey());
}
this.properties.put(property.getKey(), property);
} | java | private void declareProperty(ExecutionContextProperty property)
{
if (this.properties.containsKey(property.getKey())) {
throw new PropertyAlreadyExistsException(property.getKey());
}
this.properties.put(property.getKey(), property);
} | [
"private",
"void",
"declareProperty",
"(",
"ExecutionContextProperty",
"property",
")",
"{",
"if",
"(",
"this",
".",
"properties",
".",
"containsKey",
"(",
"property",
".",
"getKey",
"(",
")",
")",
")",
"{",
"throw",
"new",
"PropertyAlreadyExistsException",
"(",... | Declare a property.
@param property The property with configured metadata attributes.
@throws PropertyAlreadyExistsException if the property alread exists in this execution context.
@since 4.3M1 | [
"Declare",
"a",
"property",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-context/src/main/java/org/xwiki/context/ExecutionContext.java#L145-L152 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/InstallRequest.java | InstallRequest.setExtensionProperty | public Object setExtensionProperty(String key, Object value)
{
return getExtensionProperties().put(key, value);
} | java | public Object setExtensionProperty(String key, Object value)
{
return getExtensionProperties().put(key, value);
} | [
"public",
"Object",
"setExtensionProperty",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"getExtensionProperties",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Sets a custom extension property to be set on each of the extensions that are going to be installed from this
request.
@param key the property name
@param value the new property value
@return the previous property value
@since 7.0M2 | [
"Sets",
"a",
"custom",
"extension",
"property",
"to",
"be",
"set",
"on",
"each",
"of",
"the",
"extensions",
"that",
"are",
"going",
"to",
"be",
"installed",
"from",
"this",
"request",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/InstallRequest.java#L84-L87 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java | BcDSAKeyParameterGenerator.getDsaParameters | org.bouncycastle.crypto.params.DSAParameters getDsaParameters(SecureRandom random,
DSAKeyParametersGenerationParameters params)
{
DSAParametersGenerator paramGen = getGenerator(params.getHashHint());
if (params.use186r3()) {
DSAParameterGenerationParameters p = new DSAParameterG... | java | org.bouncycastle.crypto.params.DSAParameters getDsaParameters(SecureRandom random,
DSAKeyParametersGenerationParameters params)
{
DSAParametersGenerator paramGen = getGenerator(params.getHashHint());
if (params.use186r3()) {
DSAParameterGenerationParameters p = new DSAParameterG... | [
"org",
".",
"bouncycastle",
".",
"crypto",
".",
"params",
".",
"DSAParameters",
"getDsaParameters",
"(",
"SecureRandom",
"random",
",",
"DSAKeyParametersGenerationParameters",
"params",
")",
"{",
"DSAParametersGenerator",
"paramGen",
"=",
"getGenerator",
"(",
"params",
... | Generate DSA parameters.
Shared with the key generator to optimize key generation.
@param params the parameters generation parameters.
@return shared DSA parameters for key generation. | [
"Generate",
"DSA",
"parameters",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java#L92-L108 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java | BcDSAKeyParameterGenerator.getGenerator | private DSAParametersGenerator getGenerator(String hint)
{
if (hint == null || "SHA-1".equals(hint)) {
return new DSAParametersGenerator();
}
DigestFactory factory;
try {
factory = this.manager.getInstance(DigestFactory.class, hint);
} catch (Compone... | java | private DSAParametersGenerator getGenerator(String hint)
{
if (hint == null || "SHA-1".equals(hint)) {
return new DSAParametersGenerator();
}
DigestFactory factory;
try {
factory = this.manager.getInstance(DigestFactory.class, hint);
} catch (Compone... | [
"private",
"DSAParametersGenerator",
"getGenerator",
"(",
"String",
"hint",
")",
"{",
"if",
"(",
"hint",
"==",
"null",
"||",
"\"SHA-1\"",
".",
"equals",
"(",
"hint",
")",
")",
"{",
"return",
"new",
"DSAParametersGenerator",
"(",
")",
";",
"}",
"DigestFactory... | Create an instance of a DSA parameter generator using the appropriate hash algorithm.
@param hint hint of the hash algorithm to use.
@return a DSA parameter generator. | [
"Create",
"an",
"instance",
"of",
"a",
"DSA",
"parameter",
"generator",
"using",
"the",
"appropriate",
"hash",
"algorithm",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java#L116-L137 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java | BcDSAKeyParameterGenerator.getUsageIndex | static int getUsageIndex(DSAKeyValidationParameters.Usage usage)
{
if (usage == DSAKeyValidationParameters.Usage.DIGITAL_SIGNATURE) {
return DSAParameterGenerationParameters.DIGITAL_SIGNATURE_USAGE;
} else if (usage == DSAKeyValidationParameters.Usage.KEY_ESTABLISHMENT) {
ret... | java | static int getUsageIndex(DSAKeyValidationParameters.Usage usage)
{
if (usage == DSAKeyValidationParameters.Usage.DIGITAL_SIGNATURE) {
return DSAParameterGenerationParameters.DIGITAL_SIGNATURE_USAGE;
} else if (usage == DSAKeyValidationParameters.Usage.KEY_ESTABLISHMENT) {
ret... | [
"static",
"int",
"getUsageIndex",
"(",
"DSAKeyValidationParameters",
".",
"Usage",
"usage",
")",
"{",
"if",
"(",
"usage",
"==",
"DSAKeyValidationParameters",
".",
"Usage",
".",
"DIGITAL_SIGNATURE",
")",
"{",
"return",
"DSAParameterGenerationParameters",
".",
"DIGITAL_... | Convert key usage to key usage index.
Shared with the key generator to optimize key generation.
@param usage a key usage.
@return a BC key usage index. | [
"Convert",
"key",
"usage",
"to",
"key",
"usage",
"index",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java#L147-L155 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java | BcDSAKeyParameterGenerator.getUsage | private static DSAKeyValidationParameters.Usage getUsage(int usage)
{
if (usage == DSAParameterGenerationParameters.DIGITAL_SIGNATURE_USAGE) {
return DSAKeyValidationParameters.Usage.DIGITAL_SIGNATURE;
} else if (usage == DSAParameterGenerationParameters.KEY_ESTABLISHMENT_USAGE) {
... | java | private static DSAKeyValidationParameters.Usage getUsage(int usage)
{
if (usage == DSAParameterGenerationParameters.DIGITAL_SIGNATURE_USAGE) {
return DSAKeyValidationParameters.Usage.DIGITAL_SIGNATURE;
} else if (usage == DSAParameterGenerationParameters.KEY_ESTABLISHMENT_USAGE) {
... | [
"private",
"static",
"DSAKeyValidationParameters",
".",
"Usage",
"getUsage",
"(",
"int",
"usage",
")",
"{",
"if",
"(",
"usage",
"==",
"DSAParameterGenerationParameters",
".",
"DIGITAL_SIGNATURE_USAGE",
")",
"{",
"return",
"DSAKeyValidationParameters",
".",
"Usage",
".... | Convert usage index to key usage.
@param usage usage index.
@return key usage. | [
"Convert",
"usage",
"index",
"to",
"key",
"usage",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDSAKeyParameterGenerator.java#L163-L171 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.addURL | @Override
public void addURL(URL url)
{
this.finder.addURI(URI.create(url.toExternalForm()));
} | java | @Override
public void addURL(URL url)
{
this.finder.addURI(URI.create(url.toExternalForm()));
} | [
"@",
"Override",
"public",
"void",
"addURL",
"(",
"URL",
"url",
")",
"{",
"this",
".",
"finder",
".",
"addURI",
"(",
"URI",
".",
"create",
"(",
"url",
".",
"toExternalForm",
"(",
")",
")",
")",
";",
"}"
] | Add specified URL at the end of the search path.
@param url the URL to add | [
"Add",
"specified",
"URL",
"at",
"the",
"end",
"of",
"the",
"search",
"path",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L143-L147 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.addURLs | @Override
public void addURLs(List<URL> urls)
{
for (URL url : urls) {
addURL(url);
}
} | java | @Override
public void addURLs(List<URL> urls)
{
for (URL url : urls) {
addURL(url);
}
} | [
"@",
"Override",
"public",
"void",
"addURLs",
"(",
"List",
"<",
"URL",
">",
"urls",
")",
"{",
"for",
"(",
"URL",
"url",
":",
"urls",
")",
"{",
"addURL",
"(",
"url",
")",
";",
"}",
"}"
] | Add specified URLs at the end of the search path.
@param urls the URLs to add | [
"Add",
"specified",
"URLs",
"at",
"the",
"end",
"of",
"the",
"search",
"path",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L154-L160 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.findClass | @Override
protected Class<?> findClass(final String name) throws ClassNotFoundException
{
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>()
{
@Override
public Class<?> run() throws ClassNotFoundException
... | java | @Override
protected Class<?> findClass(final String name) throws ClassNotFoundException
{
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>()
{
@Override
public Class<?> run() throws ClassNotFoundException
... | [
"@",
"Override",
"protected",
"Class",
"<",
"?",
">",
"findClass",
"(",
"final",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"Class",
... | Finds and loads the class with the specified name.
@param name the name of the class
@return the resulting class
@exception ClassNotFoundException if the class could not be found | [
"Finds",
"and",
"loads",
"the",
"class",
"with",
"the",
"specified",
"name",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L175-L200 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.isSealed | private boolean isSealed(String name, Manifest man)
{
String path = name.replace('.', '/').concat("/");
Attributes attr = man.getAttributes(path);
String sealed = null;
if (attr != null) {
sealed = attr.getValue(Name.SEALED);
}
if (sealed == null) {
... | java | private boolean isSealed(String name, Manifest man)
{
String path = name.replace('.', '/').concat("/");
Attributes attr = man.getAttributes(path);
String sealed = null;
if (attr != null) {
sealed = attr.getValue(Name.SEALED);
}
if (sealed == null) {
... | [
"private",
"boolean",
"isSealed",
"(",
"String",
"name",
",",
"Manifest",
"man",
")",
"{",
"String",
"path",
"=",
"name",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
".",
"concat",
"(",
"\"/\"",
")",
";",
"Attributes",
"attr",
"=",
"man",
".... | returns true if the specified package name is sealed according to the given manifest. | [
"returns",
"true",
"if",
"the",
"specified",
"package",
"name",
"is",
"sealed",
"according",
"to",
"the",
"given",
"manifest",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L244-L258 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.findResource | @Override
public URL findResource(final String name)
{
return AccessController.doPrivileged(new PrivilegedAction<URL>()
{
@Override
public URL run()
{
return URIClassLoader.this.finder.findResource(name);
}
}, this.acc);
... | java | @Override
public URL findResource(final String name)
{
return AccessController.doPrivileged(new PrivilegedAction<URL>()
{
@Override
public URL run()
{
return URIClassLoader.this.finder.findResource(name);
}
}, this.acc);
... | [
"@",
"Override",
"public",
"URL",
"findResource",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"URL",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"URL",
"run",
"(",
")"... | Finds the resource with the specified name.
@param name the name of the resource
@return a <code>URL</code> for the resource, or <code>null</code> if the resource could not be found. | [
"Finds",
"the",
"resource",
"with",
"the",
"specified",
"name",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L266-L277 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.findResources | @Override
public Enumeration<URL> findResources(final String name) throws IOException
{
return AccessController.doPrivileged(new PrivilegedAction<Enumeration<URL>>()
{
@Override
public Enumeration<URL> run()
{
return URIClassLoader.this.finder.... | java | @Override
public Enumeration<URL> findResources(final String name) throws IOException
{
return AccessController.doPrivileged(new PrivilegedAction<Enumeration<URL>>()
{
@Override
public Enumeration<URL> run()
{
return URIClassLoader.this.finder.... | [
"@",
"Override",
"public",
"Enumeration",
"<",
"URL",
">",
"findResources",
"(",
"final",
"String",
"name",
")",
"throws",
"IOException",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Enumeration",
"<",
"URL",
">",... | Returns an Enumeration of URLs representing all of the resources having the specified name.
@param name the resource name
@exception IOException if an I/O exception occurs
@return an <code>Enumeration</code> of <code>URL</code>s | [
"Returns",
"an",
"Enumeration",
"of",
"URLs",
"representing",
"all",
"of",
"the",
"resources",
"having",
"the",
"specified",
"name",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L286-L297 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.getResourceHandle | protected ResourceHandle getResourceHandle(final String name)
{
return AccessController.doPrivileged(new PrivilegedAction<ResourceHandle>()
{
@Override
public ResourceHandle run()
{
return URIClassLoader.this.finder.getResource(name);
}... | java | protected ResourceHandle getResourceHandle(final String name)
{
return AccessController.doPrivileged(new PrivilegedAction<ResourceHandle>()
{
@Override
public ResourceHandle run()
{
return URIClassLoader.this.finder.getResource(name);
}... | [
"protected",
"ResourceHandle",
"getResourceHandle",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"ResourceHandle",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"ResourceHandle",
... | Finds the ResourceHandle object for the resource with the specified name.
@param name the name of the resource
@return the ResourceHandle of the resource | [
"Finds",
"the",
"ResourceHandle",
"object",
"for",
"the",
"resource",
"with",
"the",
"specified",
"name",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L346-L356 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java | URIClassLoader.getResourceHandles | protected Enumeration<ResourceHandle> getResourceHandles(final String name)
{
return AccessController.doPrivileged(new PrivilegedAction<Enumeration<ResourceHandle>>()
{
@Override
public Enumeration<ResourceHandle> run()
{
return URIClassLoader.this... | java | protected Enumeration<ResourceHandle> getResourceHandles(final String name)
{
return AccessController.doPrivileged(new PrivilegedAction<Enumeration<ResourceHandle>>()
{
@Override
public Enumeration<ResourceHandle> run()
{
return URIClassLoader.this... | [
"protected",
"Enumeration",
"<",
"ResourceHandle",
">",
"getResourceHandles",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Enumeration",
"<",
"ResourceHandle",
">",
">",
"(",
")"... | Returns an Enumeration of ResourceHandle objects representing all of the resources having the specified name.
@param name the name of the resource
@return the ResourceHandle of the resource | [
"Returns",
"an",
"Enumeration",
"of",
"ResourceHandle",
"objects",
"representing",
"all",
"of",
"the",
"resources",
"having",
"the",
"specified",
"name",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/URIClassLoader.java#L392-L402 | train |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractVerifyMojo.java | AbstractVerifyMojo.initializePatterns | protected void initializePatterns()
{
this.contentPagePatterns = initializationPagePatterns(this.contentPages);
this.technicalPagePatterns = initializationPagePatterns(this.technicalPages);
// Transform title expectations into Patterns
Map<Pattern, Pattern> patterns = new HashMap<>(... | java | protected void initializePatterns()
{
this.contentPagePatterns = initializationPagePatterns(this.contentPages);
this.technicalPagePatterns = initializationPagePatterns(this.technicalPages);
// Transform title expectations into Patterns
Map<Pattern, Pattern> patterns = new HashMap<>(... | [
"protected",
"void",
"initializePatterns",
"(",
")",
"{",
"this",
".",
"contentPagePatterns",
"=",
"initializationPagePatterns",
"(",
"this",
".",
"contentPages",
")",
";",
"this",
".",
"technicalPagePatterns",
"=",
"initializationPagePatterns",
"(",
"this",
".",
"t... | Initialize regex Patterns for performance reasons. | [
"Initialize",
"regex",
"Patterns",
"for",
"performance",
"reasons",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractVerifyMojo.java#L167-L178 | train |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractVerifyMojo.java | AbstractVerifyMojo.executeLicenseGoal | protected void executeLicenseGoal(String goal) throws MojoExecutionException
{
// Find the license plugin (it's project's responsibility to make sure the License plugin is properly setup in
// its <pluginManagement>, for most XWiki projects it just mean inherits from xwiki-commons-pom)
Plugi... | java | protected void executeLicenseGoal(String goal) throws MojoExecutionException
{
// Find the license plugin (it's project's responsibility to make sure the License plugin is properly setup in
// its <pluginManagement>, for most XWiki projects it just mean inherits from xwiki-commons-pom)
Plugi... | [
"protected",
"void",
"executeLicenseGoal",
"(",
"String",
"goal",
")",
"throws",
"MojoExecutionException",
"{",
"// Find the license plugin (it's project's responsibility to make sure the License plugin is properly setup in",
"// its <pluginManagement>, for most XWiki projects it just mean inh... | Executes a goal of the Maven License plugin (used for adding or checking for license headers.
@param goal the goal of the Maven License plugin to call
@exception MojoExecutionException when the License plugins fails or if it's not found | [
"Executes",
"a",
"goal",
"of",
"the",
"Maven",
"License",
"plugin",
"(",
"used",
"for",
"adding",
"or",
"checking",
"for",
"license",
"headers",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/AbstractVerifyMojo.java#L361-L389 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/ColorConverter.java | ColorConverter.parseRGB | protected Color parseRGB(String value)
{
StringTokenizer items = new StringTokenizer(value, ",");
try {
int red = 0;
if (items.hasMoreTokens()) {
red = Integer.parseInt(items.nextToken().trim());
}
int green = 0;
if (items... | java | protected Color parseRGB(String value)
{
StringTokenizer items = new StringTokenizer(value, ",");
try {
int red = 0;
if (items.hasMoreTokens()) {
red = Integer.parseInt(items.nextToken().trim());
}
int green = 0;
if (items... | [
"protected",
"Color",
"parseRGB",
"(",
"String",
"value",
")",
"{",
"StringTokenizer",
"items",
"=",
"new",
"StringTokenizer",
"(",
"value",
",",
"\",\"",
")",
";",
"try",
"{",
"int",
"red",
"=",
"0",
";",
"if",
"(",
"items",
".",
"hasMoreTokens",
"(",
... | Parsers a String in the form "x, y, z" into an SWT RGB class.
@param value the color as String
@return RGB | [
"Parsers",
"a",
"String",
"in",
"the",
"form",
"x",
"y",
"z",
"into",
"an",
"SWT",
"RGB",
"class",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/ColorConverter.java#L73-L97 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java | ResourceLoader.getResource | public ResourceHandle getResource(URL source, String name)
{
return getResource(source, name, new HashSet<>(), null);
} | java | public ResourceHandle getResource(URL source, String name)
{
return getResource(source, name, new HashSet<>(), null);
} | [
"public",
"ResourceHandle",
"getResource",
"(",
"URL",
"source",
",",
"String",
"name",
")",
"{",
"return",
"getResource",
"(",
"source",
",",
"name",
",",
"new",
"HashSet",
"<>",
"(",
")",
",",
"null",
")",
";",
"}"
] | Gets resource with given name at the given source URL. If the URL points to a directory, the name is the file
path relative to this directory. If the URL points to a JAR file, the name identifies an entry in that JAR file.
If the URL points to a JAR file, the resource is not found in that JAR file, and the JAR file has... | [
"Gets",
"resource",
"with",
"given",
"name",
"at",
"the",
"given",
"source",
"URL",
".",
"If",
"the",
"URL",
"points",
"to",
"a",
"directory",
"the",
"name",
"is",
"the",
"file",
"path",
"relative",
"to",
"this",
"directory",
".",
"If",
"the",
"URL",
"... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java#L115-L118 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java | ResourceLoader.getResource | public ResourceHandle getResource(URL[] sources, String name)
{
Set<URL> visited = new HashSet<>();
for (URL source : sources) {
ResourceHandle h = getResource(source, name, visited, null);
if (h != null) {
return h;
}
}
return null... | java | public ResourceHandle getResource(URL[] sources, String name)
{
Set<URL> visited = new HashSet<>();
for (URL source : sources) {
ResourceHandle h = getResource(source, name, visited, null);
if (h != null) {
return h;
}
}
return null... | [
"public",
"ResourceHandle",
"getResource",
"(",
"URL",
"[",
"]",
"sources",
",",
"String",
"name",
")",
"{",
"Set",
"<",
"URL",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"URL",
"source",
":",
"sources",
")",
"{",
"Resour... | Gets resource with given name at the given search path. The path is searched iteratively, one URL at a time. If
the URL points to a directory, the name is the file path relative to this directory. If the URL points to the JAR
file, the name identifies an entry in that JAR file. If the URL points to the JAR file, the re... | [
"Gets",
"resource",
"with",
"given",
"name",
"at",
"the",
"given",
"search",
"path",
".",
"The",
"path",
"is",
"searched",
"iteratively",
"one",
"URL",
"at",
"a",
"time",
".",
"If",
"the",
"URL",
"points",
"to",
"a",
"directory",
"the",
"name",
"is",
"... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java#L131-L141 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java | ResourceLoader.findResource | public URL findResource(URL source, String name)
{
return findResource(source, name, new HashSet<>(), null);
} | java | public URL findResource(URL source, String name)
{
return findResource(source, name, new HashSet<>(), null);
} | [
"public",
"URL",
"findResource",
"(",
"URL",
"source",
",",
"String",
"name",
")",
"{",
"return",
"findResource",
"(",
"source",
",",
"name",
",",
"new",
"HashSet",
"<>",
"(",
")",
",",
"null",
")",
";",
"}"
] | Fined resource with given name at the given source URL. If the URL points to a directory, the name is the file
path relative to this directory. If the URL points to a JAR file, the name identifies an entry in that JAR file.
If the URL points to a JAR file, the resource is not found in that JAR file, and the JAR file ha... | [
"Fined",
"resource",
"with",
"given",
"name",
"at",
"the",
"given",
"source",
"URL",
".",
"If",
"the",
"URL",
"points",
"to",
"a",
"directory",
"the",
"name",
"is",
"the",
"file",
"path",
"relative",
"to",
"this",
"directory",
".",
"If",
"the",
"URL",
... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java#L267-L270 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java | ResourceLoader.findResource | public URL findResource(URL[] sources, String name)
{
Set<URL> visited = new HashSet<>();
for (URL source : sources) {
URL url = findResource(source, name, visited, null);
if (url != null) {
return url;
}
}
return null;
} | java | public URL findResource(URL[] sources, String name)
{
Set<URL> visited = new HashSet<>();
for (URL source : sources) {
URL url = findResource(source, name, visited, null);
if (url != null) {
return url;
}
}
return null;
} | [
"public",
"URL",
"findResource",
"(",
"URL",
"[",
"]",
"sources",
",",
"String",
"name",
")",
"{",
"Set",
"<",
"URL",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"URL",
"source",
":",
"sources",
")",
"{",
"URL",
"url",
... | Finds resource with given name at the given search path. The path is searched iteratively, one URL at a time. If
the URL points to a directory, the name is the file path relative to this directory. If the URL points to the JAR
file, the name identifies an entry in that JAR file. If the URL points to the JAR file, the r... | [
"Finds",
"resource",
"with",
"given",
"name",
"at",
"the",
"given",
"search",
"path",
".",
"The",
"path",
"is",
"searched",
"iteratively",
"one",
"URL",
"at",
"a",
"time",
".",
"If",
"the",
"URL",
"points",
"to",
"a",
"directory",
"the",
"name",
"is",
... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java#L283-L293 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-text/src/main/java/org/xwiki/text/StringUtils.java | StringUtils.toAlphaNumeric | @Unstable
public static String toAlphaNumeric(String text)
{
if (isEmpty(text)) {
return text;
}
return stripAccents(text).replaceAll("[^a-zA-Z0-9]", "");
} | java | @Unstable
public static String toAlphaNumeric(String text)
{
if (isEmpty(text)) {
return text;
}
return stripAccents(text).replaceAll("[^a-zA-Z0-9]", "");
} | [
"@",
"Unstable",
"public",
"static",
"String",
"toAlphaNumeric",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"text",
")",
")",
"{",
"return",
"text",
";",
"}",
"return",
"stripAccents",
"(",
"text",
")",
".",
"replaceAll",
"(",
"\"[^a-zA-... | Removes all non alpha numerical characters from the passed text. First tries to convert diacritics to their
alpha numeric representation.
@param text the text to convert
@return the alpha numeric equivalent
@since 10.6RC1 | [
"Removes",
"all",
"non",
"alpha",
"numerical",
"characters",
"from",
"the",
"passed",
"text",
".",
"First",
"tries",
"to",
"convert",
"diacritics",
"to",
"their",
"alpha",
"numeric",
"representation",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-text/src/main/java/org/xwiki/text/StringUtils.java#L77-L85 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java | BcExtensionUtils.getX509GeneralNames | public static List<X509GeneralName> getX509GeneralNames(GeneralNames genNames)
{
if (genNames == null) {
return null;
}
GeneralName[] names = genNames.getNames();
List<X509GeneralName> x509names = new ArrayList<X509GeneralName>(names.length);
for (GeneralName na... | java | public static List<X509GeneralName> getX509GeneralNames(GeneralNames genNames)
{
if (genNames == null) {
return null;
}
GeneralName[] names = genNames.getNames();
List<X509GeneralName> x509names = new ArrayList<X509GeneralName>(names.length);
for (GeneralName na... | [
"public",
"static",
"List",
"<",
"X509GeneralName",
">",
"getX509GeneralNames",
"(",
"GeneralNames",
"genNames",
")",
"{",
"if",
"(",
"genNames",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"GeneralName",
"[",
"]",
"names",
"=",
"genNames",
".",
"g... | Convert general names from Bouncy Castle general names.
@param genNames Bouncy castle general names.
@return a list of X.509 general names. | [
"Convert",
"general",
"names",
"from",
"Bouncy",
"Castle",
"general",
"names",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java#L63-L96 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java | BcExtensionUtils.getSetOfKeyUsage | public static EnumSet<KeyUsage> getSetOfKeyUsage(org.bouncycastle.asn1.x509.KeyUsage keyUsage)
{
if (keyUsage == null) {
return null;
}
Collection<KeyUsage> usages = new ArrayList<KeyUsage>();
for (KeyUsage usage : KeyUsage.values()) {
if ((((DERBitString) k... | java | public static EnumSet<KeyUsage> getSetOfKeyUsage(org.bouncycastle.asn1.x509.KeyUsage keyUsage)
{
if (keyUsage == null) {
return null;
}
Collection<KeyUsage> usages = new ArrayList<KeyUsage>();
for (KeyUsage usage : KeyUsage.values()) {
if ((((DERBitString) k... | [
"public",
"static",
"EnumSet",
"<",
"KeyUsage",
">",
"getSetOfKeyUsage",
"(",
"org",
".",
"bouncycastle",
".",
"asn1",
".",
"x509",
".",
"KeyUsage",
"keyUsage",
")",
"{",
"if",
"(",
"keyUsage",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Collect... | Convert usages from Bouncy Castle.
@param keyUsage the bouncy castle key usage to convert.
@return the set of authorized usages. | [
"Convert",
"usages",
"from",
"Bouncy",
"Castle",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java#L104-L118 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java | BcExtensionUtils.getExtendedKeyUsages | public static ExtendedKeyUsages getExtendedKeyUsages(ExtendedKeyUsage usages)
{
if (usages == null) {
return null;
}
List<String> usageStr = new ArrayList<String>();
for (KeyPurposeId keyPurposeId : usages.getUsages()) {
usageStr.add(keyPurposeId.getId());
... | java | public static ExtendedKeyUsages getExtendedKeyUsages(ExtendedKeyUsage usages)
{
if (usages == null) {
return null;
}
List<String> usageStr = new ArrayList<String>();
for (KeyPurposeId keyPurposeId : usages.getUsages()) {
usageStr.add(keyPurposeId.getId());
... | [
"public",
"static",
"ExtendedKeyUsages",
"getExtendedKeyUsages",
"(",
"ExtendedKeyUsage",
"usages",
")",
"{",
"if",
"(",
"usages",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"usageStr",
"=",
"new",
"ArrayList",
"<",
"Stri... | Convert extended usages from Bouncy Castle.
@param usages the bouncy castle extended key usage to convert.
@return the set of authorized usages. | [
"Convert",
"extended",
"usages",
"from",
"Bouncy",
"Castle",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java#L126-L139 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java | BcExtensionUtils.getGeneralNames | public static GeneralNames getGeneralNames(X509GeneralName[] genNames)
{
GeneralName[] names = new GeneralName[genNames.length];
int i = 0;
for (X509GeneralName name : genNames) {
if (name instanceof BcGeneralName) {
names[i++] = ((BcGeneralName) name).getGeneral... | java | public static GeneralNames getGeneralNames(X509GeneralName[] genNames)
{
GeneralName[] names = new GeneralName[genNames.length];
int i = 0;
for (X509GeneralName name : genNames) {
if (name instanceof BcGeneralName) {
names[i++] = ((BcGeneralName) name).getGeneral... | [
"public",
"static",
"GeneralNames",
"getGeneralNames",
"(",
"X509GeneralName",
"[",
"]",
"genNames",
")",
"{",
"GeneralName",
"[",
"]",
"names",
"=",
"new",
"GeneralName",
"[",
"genNames",
".",
"length",
"]",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"... | Convert a collection of X.509 general names to Bouncy Castle general names.
@param genNames a collection of X.509 general names.
@return a bouncy castle general names. | [
"Convert",
"a",
"collection",
"of",
"X",
".",
"509",
"general",
"names",
"to",
"Bouncy",
"Castle",
"general",
"names",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java#L147-L161 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java | BcExtensionUtils.getKeyUsage | public static org.bouncycastle.asn1.x509.KeyUsage getKeyUsage(EnumSet<KeyUsage> usages)
{
int bitmask = 0;
for (KeyUsage usage : usages) {
bitmask |= usage.value();
}
return new org.bouncycastle.asn1.x509.KeyUsage(bitmask);
} | java | public static org.bouncycastle.asn1.x509.KeyUsage getKeyUsage(EnumSet<KeyUsage> usages)
{
int bitmask = 0;
for (KeyUsage usage : usages) {
bitmask |= usage.value();
}
return new org.bouncycastle.asn1.x509.KeyUsage(bitmask);
} | [
"public",
"static",
"org",
".",
"bouncycastle",
".",
"asn1",
".",
"x509",
".",
"KeyUsage",
"getKeyUsage",
"(",
"EnumSet",
"<",
"KeyUsage",
">",
"usages",
")",
"{",
"int",
"bitmask",
"=",
"0",
";",
"for",
"(",
"KeyUsage",
"usage",
":",
"usages",
")",
"{... | Convert a set of key usages to Bouncy Castle key usage.
@param usages the set of authorized usages.
@return a bit mask | [
"Convert",
"a",
"set",
"of",
"key",
"usages",
"to",
"Bouncy",
"Castle",
"key",
"usage",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java#L169-L176 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java | BcExtensionUtils.getExtendedKeyUsage | public static ExtendedKeyUsage getExtendedKeyUsage(Set<String> usages)
{
KeyPurposeId[] keyUsages = new KeyPurposeId[usages.size()];
int i = 0;
for (String usage : usages) {
keyUsages[i++] = KeyPurposeId.getInstance(new ASN1ObjectIdentifier(usage));
}
return new... | java | public static ExtendedKeyUsage getExtendedKeyUsage(Set<String> usages)
{
KeyPurposeId[] keyUsages = new KeyPurposeId[usages.size()];
int i = 0;
for (String usage : usages) {
keyUsages[i++] = KeyPurposeId.getInstance(new ASN1ObjectIdentifier(usage));
}
return new... | [
"public",
"static",
"ExtendedKeyUsage",
"getExtendedKeyUsage",
"(",
"Set",
"<",
"String",
">",
"usages",
")",
"{",
"KeyPurposeId",
"[",
"]",
"keyUsages",
"=",
"new",
"KeyPurposeId",
"[",
"usages",
".",
"size",
"(",
")",
"]",
";",
"int",
"i",
"=",
"0",
";... | Convert a set of extended key usages to Bouncy Castle extended key usage.
@param usages the set of authorized usages.
@return a bit mask | [
"Convert",
"a",
"set",
"of",
"extended",
"key",
"usages",
"to",
"Bouncy",
"Castle",
"extended",
"key",
"usage",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/BcExtensionUtils.java#L184-L194 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java | EmbeddableComponentManager.initialize | public void initialize(ClassLoader classLoader)
{
ComponentAnnotationLoader loader = new ComponentAnnotationLoader();
loader.initialize(this, classLoader);
// Extension point to allow component to manipulate ComponentManager initialized state.
try {
List<ComponentManager... | java | public void initialize(ClassLoader classLoader)
{
ComponentAnnotationLoader loader = new ComponentAnnotationLoader();
loader.initialize(this, classLoader);
// Extension point to allow component to manipulate ComponentManager initialized state.
try {
List<ComponentManager... | [
"public",
"void",
"initialize",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"ComponentAnnotationLoader",
"loader",
"=",
"new",
"ComponentAnnotationLoader",
"(",
")",
";",
"loader",
".",
"initialize",
"(",
"this",
",",
"classLoader",
")",
";",
"// Extension point to... | Load all component annotations and register them as components.
@param classLoader the class loader to use to look for component definitions | [
"Load",
"all",
"component",
"annotations",
"and",
"register",
"them",
"as",
"components",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java#L153-L168 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/stax/SAXEventWriter.java | SAXEventWriter.getAttributes | private Attributes getAttributes(StartElement event)
{
AttributesImpl attrs = new AttributesImpl();
if (!event.isStartElement()) {
throw new InternalError("getAttributes() attempting to process: " + event);
}
// Add namspace declarations if required
if (this.fil... | java | private Attributes getAttributes(StartElement event)
{
AttributesImpl attrs = new AttributesImpl();
if (!event.isStartElement()) {
throw new InternalError("getAttributes() attempting to process: " + event);
}
// Add namspace declarations if required
if (this.fil... | [
"private",
"Attributes",
"getAttributes",
"(",
"StartElement",
"event",
")",
"{",
"AttributesImpl",
"attrs",
"=",
"new",
"AttributesImpl",
"(",
")",
";",
"if",
"(",
"!",
"event",
".",
"isStartElement",
"(",
")",
")",
"{",
"throw",
"new",
"InternalError",
"("... | Get the attributes associated with the given START_ELEMENT StAXevent.
@param event the StAX start element event
@return the StAX attributes converted to an org.xml.sax.Attributes | [
"Get",
"the",
"attributes",
"associated",
"with",
"the",
"given",
"START_ELEMENT",
"StAXevent",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/stax/SAXEventWriter.java#L256-L311 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/xstream/SafeTreeMarshallingStrategy.java | SafeTreeMarshallingStrategy.createMarshallingContext | @Override
protected TreeMarshaller createMarshallingContext(HierarchicalStreamWriter writer, ConverterLookup converterLookup,
Mapper mapper)
{
return new SafeTreeMarshaller(writer, converterLookup, mapper, RELATIVE);
} | java | @Override
protected TreeMarshaller createMarshallingContext(HierarchicalStreamWriter writer, ConverterLookup converterLookup,
Mapper mapper)
{
return new SafeTreeMarshaller(writer, converterLookup, mapper, RELATIVE);
} | [
"@",
"Override",
"protected",
"TreeMarshaller",
"createMarshallingContext",
"(",
"HierarchicalStreamWriter",
"writer",
",",
"ConverterLookup",
"converterLookup",
",",
"Mapper",
"mapper",
")",
"{",
"return",
"new",
"SafeTreeMarshaller",
"(",
"writer",
",",
"converterLookup... | If anything goes wrong with an element, don't serialize it | [
"If",
"anything",
"goes",
"wrong",
"with",
"an",
"element",
"don",
"t",
"serialize",
"it"
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/xstream/SafeTreeMarshallingStrategy.java#L55-L60 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/URLTool.java | URLTool.parseQuery | public Map<String, List<String>> parseQuery(String query)
{
Map<String, List<String>> queryParams = new LinkedHashMap<>();
if (query != null) {
for (NameValuePair params : URLEncodedUtils.parse(query, StandardCharsets.UTF_8)) {
String name = params.getName();
... | java | public Map<String, List<String>> parseQuery(String query)
{
Map<String, List<String>> queryParams = new LinkedHashMap<>();
if (query != null) {
for (NameValuePair params : URLEncodedUtils.parse(query, StandardCharsets.UTF_8)) {
String name = params.getName();
... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parseQuery",
"(",
"String",
"query",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"queryParams",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"if",
... | Parse a query string into a map of key-value pairs.
@param query query string to be parsed
@return a mapping of parameter names to values suitable e.g. to pass into {@link EscapeTool#url(Map)} | [
"Parse",
"a",
"query",
"string",
"into",
"a",
"map",
"of",
"key",
"-",
"value",
"pairs",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/URLTool.java#L45-L60 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/main/java/org/xwiki/filter/internal/FilterUtils.java | FilterUtils.sendEndEvent | public static boolean sendEndEvent(Object filter, FilterDescriptor descriptor, String id,
FilterEventParameters parameters) throws FilterException
{
FilterElementDescriptor elementDescriptor = descriptor.getElement(id);
if (elementDescriptor != null && elementDescriptor.getEndMethod() != nu... | java | public static boolean sendEndEvent(Object filter, FilterDescriptor descriptor, String id,
FilterEventParameters parameters) throws FilterException
{
FilterElementDescriptor elementDescriptor = descriptor.getElement(id);
if (elementDescriptor != null && elementDescriptor.getEndMethod() != nu... | [
"public",
"static",
"boolean",
"sendEndEvent",
"(",
"Object",
"filter",
",",
"FilterDescriptor",
"descriptor",
",",
"String",
"id",
",",
"FilterEventParameters",
"parameters",
")",
"throws",
"FilterException",
"{",
"FilterElementDescriptor",
"elementDescriptor",
"=",
"d... | Call passed end event if possible.
@param filter the filter
@param descriptor the descriptor of the filter
@param id the id of the event
@param parameters the parameters of the event
@return true if the event has been sent, false otherwise
@throws FilterException when the passed filter exposes the event but failed any... | [
"Call",
"passed",
"end",
"event",
"if",
"possible",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/main/java/org/xwiki/filter/internal/FilterUtils.java#L119-L133 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/main/java/org/xwiki/filter/internal/FilterUtils.java | FilterUtils.sendOnEvent | public static boolean sendOnEvent(Object filter, FilterDescriptor descriptor, String id,
FilterEventParameters parameters) throws FilterException
{
FilterElementDescriptor elementDescriptor = descriptor.getElement(id);
if (elementDescriptor != null && elementDescriptor.getOnMethod() != null... | java | public static boolean sendOnEvent(Object filter, FilterDescriptor descriptor, String id,
FilterEventParameters parameters) throws FilterException
{
FilterElementDescriptor elementDescriptor = descriptor.getElement(id);
if (elementDescriptor != null && elementDescriptor.getOnMethod() != null... | [
"public",
"static",
"boolean",
"sendOnEvent",
"(",
"Object",
"filter",
",",
"FilterDescriptor",
"descriptor",
",",
"String",
"id",
",",
"FilterEventParameters",
"parameters",
")",
"throws",
"FilterException",
"{",
"FilterElementDescriptor",
"elementDescriptor",
"=",
"de... | Call passed on event if possible.
@param filter the filter
@param descriptor the descriptor of the filter
@param id the id of the event
@param parameters the parameters of the event
@return true if the event has been sent, false otherwise
@throws FilterException when the passed filter exposes the event but failed anyw... | [
"Call",
"passed",
"on",
"event",
"if",
"possible",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-filter/xwiki-commons-filter-api/src/main/java/org/xwiki/filter/internal/FilterUtils.java#L145-L159 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-local/src/main/java/org/xwiki/observation/internal/DefaultObservationManager.java | DefaultObservationManager.onEventListenerComponentAdded | private void onEventListenerComponentAdded(ComponentDescriptorAddedEvent event, ComponentManager componentManager,
ComponentDescriptor<EventListener> descriptor)
{
try {
EventListener eventListener = componentManager.getInstance(EventListener.class, event.getRoleHint());
if ... | java | private void onEventListenerComponentAdded(ComponentDescriptorAddedEvent event, ComponentManager componentManager,
ComponentDescriptor<EventListener> descriptor)
{
try {
EventListener eventListener = componentManager.getInstance(EventListener.class, event.getRoleHint());
if ... | [
"private",
"void",
"onEventListenerComponentAdded",
"(",
"ComponentDescriptorAddedEvent",
"event",
",",
"ComponentManager",
"componentManager",
",",
"ComponentDescriptor",
"<",
"EventListener",
">",
"descriptor",
")",
"{",
"try",
"{",
"EventListener",
"eventListener",
"=",
... | An Event Listener Component has been dynamically registered in the system, add it to our cache.
@param event event object containing the new component descriptor
@param componentManager the {@link ComponentManager} where the descriptor is registered
@param descriptor the component descriptor removed from component man... | [
"An",
"Event",
"Listener",
"Component",
"has",
"been",
"dynamically",
"registered",
"in",
"the",
"system",
"add",
"it",
"to",
"our",
"cache",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-local/src/main/java/org/xwiki/observation/internal/DefaultObservationManager.java#L360-L377 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-local/src/main/java/org/xwiki/observation/internal/DefaultObservationManager.java | DefaultObservationManager.onEventListenerComponentRemoved | private void onEventListenerComponentRemoved(ComponentDescriptorRemovedEvent event,
ComponentManager componentManager, ComponentDescriptor<?> descriptor)
{
EventListener removedEventListener = null;
for (EventListener eventListener : getListenersByName().values()) {
if (eventList... | java | private void onEventListenerComponentRemoved(ComponentDescriptorRemovedEvent event,
ComponentManager componentManager, ComponentDescriptor<?> descriptor)
{
EventListener removedEventListener = null;
for (EventListener eventListener : getListenersByName().values()) {
if (eventList... | [
"private",
"void",
"onEventListenerComponentRemoved",
"(",
"ComponentDescriptorRemovedEvent",
"event",
",",
"ComponentManager",
"componentManager",
",",
"ComponentDescriptor",
"<",
"?",
">",
"descriptor",
")",
"{",
"EventListener",
"removedEventListener",
"=",
"null",
";",
... | An Event Listener Component has been dynamically unregistered in the system, remove it from our cache.
@param event the event object containing the removed component descriptor
@param componentManager the {@link ComponentManager} where the descriptor is registered
@param descriptor the component descriptor removed fro... | [
"An",
"Event",
"Listener",
"Component",
"has",
"been",
"dynamically",
"unregistered",
"in",
"the",
"system",
"remove",
"it",
"from",
"our",
"cache",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-local/src/main/java/org/xwiki/observation/internal/DefaultObservationManager.java#L386-L399 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-signer/src/main/java/org/xwiki/crypto/signer/internal/factory/AbstractBcSignerFactory.java | AbstractBcSignerFactory.getBcCipherParameter | protected org.bouncycastle.crypto.CipherParameters getBcCipherParameter(AsymmetricCipherParameters parameters)
{
if (parameters instanceof BcAsymmetricKeyParameters) {
return ((BcAsymmetricKeyParameters) parameters).getParameters();
}
// TODO: convert parameters to compatible on... | java | protected org.bouncycastle.crypto.CipherParameters getBcCipherParameter(AsymmetricCipherParameters parameters)
{
if (parameters instanceof BcAsymmetricKeyParameters) {
return ((BcAsymmetricKeyParameters) parameters).getParameters();
}
// TODO: convert parameters to compatible on... | [
"protected",
"org",
".",
"bouncycastle",
".",
"crypto",
".",
"CipherParameters",
"getBcCipherParameter",
"(",
"AsymmetricCipherParameters",
"parameters",
")",
"{",
"if",
"(",
"parameters",
"instanceof",
"BcAsymmetricKeyParameters",
")",
"{",
"return",
"(",
"(",
"BcAsy... | Convert cipher parameters to Bouncy Castle equivalent.
@param parameters some asymmetric cipher parameters.
@return equivalent bouncy castle parameters. | [
"Convert",
"cipher",
"parameters",
"to",
"Bouncy",
"Castle",
"equivalent",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-signer/src/main/java/org/xwiki/crypto/signer/internal/factory/AbstractBcSignerFactory.java#L91-L100 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.getDirective | public int getDirective(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context)
throws InvalidVelocityException
{
int i = currentIndex + 1;
// Get macro name
StringBuffer directiveNameBuffer = new StringBuffer();
i = getDirectiveName(array,... | java | public int getDirective(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context)
throws InvalidVelocityException
{
int i = currentIndex + 1;
// Get macro name
StringBuffer directiveNameBuffer = new StringBuffer();
i = getDirectiveName(array,... | [
"public",
"int",
"getDirective",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
",",
"StringBuffer",
"velocityBlock",
",",
"VelocityParserContext",
"context",
")",
"throws",
"InvalidVelocityException",
"{",
"int",
"i",
"=",
"currentIndex",
"+",
"1",
... | Get any valid Velocity block starting with a sharp character except comments.
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param velocityBlock the buffer where to append matched velocity block
@param context the parser context to put some informations
@return the in... | [
"Get",
"any",
"valid",
"Velocity",
"block",
"starting",
"with",
"a",
"sharp",
"character",
"except",
"comments",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L134-L179 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.getVelocityIdentifier | public int getVelocityIdentifier(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context) throws InvalidVelocityException
{
// The first character of an identifier must be a [a-zA-Z]
if (!Character.isLetter(array[currentIndex])) {
throw new Inval... | java | public int getVelocityIdentifier(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context) throws InvalidVelocityException
{
// The first character of an identifier must be a [a-zA-Z]
if (!Character.isLetter(array[currentIndex])) {
throw new Inval... | [
"public",
"int",
"getVelocityIdentifier",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
",",
"StringBuffer",
"velocityBlock",
",",
"VelocityParserContext",
"context",
")",
"throws",
"InvalidVelocityException",
"{",
"// The first character of an identifier must... | Get a valid Velocity identifier used for variable of macro.
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param velocityBlock the buffer where to append matched velocity block
@param context the parser context to put some informations
@return the index in the <code>a... | [
"Get",
"a",
"valid",
"Velocity",
"identifier",
"used",
"for",
"variable",
"of",
"macro",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L191-L210 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.getTableElement | public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context)
{
return getParameters(array, currentIndex, velocityBlock, ']', context);
} | java | public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context)
{
return getParameters(array, currentIndex, velocityBlock, ']', context);
} | [
"public",
"int",
"getTableElement",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
",",
"StringBuffer",
"velocityBlock",
",",
"VelocityParserContext",
"context",
")",
"{",
"return",
"getParameters",
"(",
"array",
",",
"currentIndex",
",",
"velocityBlo... | Get a Velocity table.
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param velocityBlock the buffer where to append matched velocity block
@param context the parser context to put some informations
@return the index in the <code>array</code> after the matched block | [
"Get",
"a",
"Velocity",
"table",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L517-L521 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/UpgradePlanJob.java | UpgradePlanJob.tryInstallExtension | protected boolean tryInstallExtension(ExtensionId extensionId, String namespace)
{
DefaultExtensionPlanTree currentTree = this.extensionTree.clone();
try {
installExtension(extensionId, namespace, currentTree);
setExtensionTree(currentTree);
return true;
... | java | protected boolean tryInstallExtension(ExtensionId extensionId, String namespace)
{
DefaultExtensionPlanTree currentTree = this.extensionTree.clone();
try {
installExtension(extensionId, namespace, currentTree);
setExtensionTree(currentTree);
return true;
... | [
"protected",
"boolean",
"tryInstallExtension",
"(",
"ExtensionId",
"extensionId",
",",
"String",
"namespace",
")",
"{",
"DefaultExtensionPlanTree",
"currentTree",
"=",
"this",
".",
"extensionTree",
".",
"clone",
"(",
")",
";",
"try",
"{",
"installExtension",
"(",
... | Try to install the provided extension and update the plan if it's working.
@param extensionId the extension version to install
@param namespace the namespace where to install the extension
@return true if the installation would succeed, false otherwise | [
"Try",
"to",
"install",
"the",
"provided",
"extension",
"and",
"update",
"the",
"plan",
"if",
"it",
"s",
"working",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/UpgradePlanJob.java#L192-L211 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/PathUtils.java | PathUtils.encode | public static String encode(String str)
{
String encoded;
try {
encoded = URLEncoder.encode(str, "UTF-8").replace(".", "%2E").replace("*", "%2A");
} catch (UnsupportedEncodingException e) {
// Should never happen
encoded = str;
}
return e... | java | public static String encode(String str)
{
String encoded;
try {
encoded = URLEncoder.encode(str, "UTF-8").replace(".", "%2E").replace("*", "%2A");
} catch (UnsupportedEncodingException e) {
// Should never happen
encoded = str;
}
return e... | [
"public",
"static",
"String",
"encode",
"(",
"String",
"str",
")",
"{",
"String",
"encoded",
";",
"try",
"{",
"encoded",
"=",
"URLEncoder",
".",
"encode",
"(",
"str",
",",
"\"UTF-8\"",
")",
".",
"replace",
"(",
"\".\"",
",",
"\"%2E\"",
")",
".",
"repla... | Protect passed String to work with as much filesystems as possible.
@param str the file or directory name to encode
@return the encoded name
@since 7.1RC1 | [
"Protect",
"passed",
"String",
"to",
"work",
"with",
"as",
"much",
"filesystems",
"as",
"possible",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/PathUtils.java#L52-L64 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-handlers/xwiki-commons-extension-handler-jar/src/main/java/org/xwiki/extension/jar/internal/handler/JarExtensionHandler.java | JarExtensionHandler.isWebjar | public static boolean isWebjar(Extension extension)
{
// Ideally webjar extensions should have "webjar" type
if (extension.getType().equals(WEBJAR)) {
return true;
}
///////////////////////////////
// But it's not the case for:
// ** webjar.org releases ... | java | public static boolean isWebjar(Extension extension)
{
// Ideally webjar extensions should have "webjar" type
if (extension.getType().equals(WEBJAR)) {
return true;
}
///////////////////////////////
// But it's not the case for:
// ** webjar.org releases ... | [
"public",
"static",
"boolean",
"isWebjar",
"(",
"Extension",
"extension",
")",
"{",
"// Ideally webjar extensions should have \"webjar\" type",
"if",
"(",
"extension",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"WEBJAR",
")",
")",
"{",
"return",
"true",
";",
... | Find of the passes extension if a webjar.
@param extension the extension to test
@return true of the passed extension is a webjar, false otherwise
@since 9.0RC1 | [
"Find",
"of",
"the",
"passes",
"extension",
"if",
"a",
"webjar",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-handlers/xwiki-commons-extension-handler-jar/src/main/java/org/xwiki/extension/jar/internal/handler/JarExtensionHandler.java#L111-L132 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/DefaultExtensionHandlerManager.java | DefaultExtensionHandlerManager.getExtensionHandler | private ExtensionHandler getExtensionHandler(LocalExtension localExtension) throws ComponentLookupException
{
return this.componentManager.getInstance(ExtensionHandler.class, localExtension.getType().toLowerCase());
} | java | private ExtensionHandler getExtensionHandler(LocalExtension localExtension) throws ComponentLookupException
{
return this.componentManager.getInstance(ExtensionHandler.class, localExtension.getType().toLowerCase());
} | [
"private",
"ExtensionHandler",
"getExtensionHandler",
"(",
"LocalExtension",
"localExtension",
")",
"throws",
"ComponentLookupException",
"{",
"return",
"this",
".",
"componentManager",
".",
"getInstance",
"(",
"ExtensionHandler",
".",
"class",
",",
"localExtension",
".",... | Get the handler corresponding to the provided extension.
@param localExtension the extension to handler
@return the handler
@throws ComponentLookupException failed to find a proper handler for the provided extension | [
"Get",
"the",
"handler",
"corresponding",
"to",
"the",
"provided",
"extension",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/DefaultExtensionHandlerManager.java#L69-L72 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.matches | public static boolean matches(Pattern patternMatcher, Collection<Filter> filters, Extension extension)
{
if (matches(patternMatcher, extension.getId().getId(), extension.getDescription(), extension.getSummary(),
extension.getName(), ExtensionIdConverter.toStringList(extension.getExtensionFeature... | java | public static boolean matches(Pattern patternMatcher, Collection<Filter> filters, Extension extension)
{
if (matches(patternMatcher, extension.getId().getId(), extension.getDescription(), extension.getSummary(),
extension.getName(), ExtensionIdConverter.toStringList(extension.getExtensionFeature... | [
"public",
"static",
"boolean",
"matches",
"(",
"Pattern",
"patternMatcher",
",",
"Collection",
"<",
"Filter",
">",
"filters",
",",
"Extension",
"extension",
")",
"{",
"if",
"(",
"matches",
"(",
"patternMatcher",
",",
"extension",
".",
"getId",
"(",
")",
".",... | Matches an extension in a case insensitive way.
@param patternMatcher the pattern to match
@param filters the filters
@param extension the extension to match
@return false if one of the filter is not matching the extension
@since 7.0M2 | [
"Matches",
"an",
"extension",
"in",
"a",
"case",
"insensitive",
"way",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L220-L234 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.matches | public static boolean matches(Collection<Filter> filters, Extension extension)
{
if (filters != null) {
for (Filter filter : filters) {
if (!matches(filter, extension)) {
return false;
}
}
}
return true;
} | java | public static boolean matches(Collection<Filter> filters, Extension extension)
{
if (filters != null) {
for (Filter filter : filters) {
if (!matches(filter, extension)) {
return false;
}
}
}
return true;
} | [
"public",
"static",
"boolean",
"matches",
"(",
"Collection",
"<",
"Filter",
">",
"filters",
",",
"Extension",
"extension",
")",
"{",
"if",
"(",
"filters",
"!=",
"null",
")",
"{",
"for",
"(",
"Filter",
"filter",
":",
"filters",
")",
"{",
"if",
"(",
"!",... | Make sure the passed extension matches all filters.
@param filters the filters
@param extension the extension to match
@return false if one of the filter is not matching the extension
@since 8.3RC1 | [
"Make",
"sure",
"the",
"passed",
"extension",
"matches",
"all",
"filters",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L244-L255 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.matches | public static boolean matches(Pattern patternMatcher, Object... elements)
{
if (patternMatcher == null) {
return true;
}
for (Object element : elements) {
if (matches(patternMatcher, element)) {
return true;
}
}
return fal... | java | public static boolean matches(Pattern patternMatcher, Object... elements)
{
if (patternMatcher == null) {
return true;
}
for (Object element : elements) {
if (matches(patternMatcher, element)) {
return true;
}
}
return fal... | [
"public",
"static",
"boolean",
"matches",
"(",
"Pattern",
"patternMatcher",
",",
"Object",
"...",
"elements",
")",
"{",
"if",
"(",
"patternMatcher",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"Object",
"element",
":",
"elements",
")",
... | Matches a set of elements in a case insensitive way.
@param patternMatcher the pattern to match
@param elements the elements to match
@return true if one of the element is matched | [
"Matches",
"a",
"set",
"of",
"elements",
"in",
"a",
"case",
"insensitive",
"way",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L308-L321 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.sort | public static void sort(List<? extends Extension> extensions, Collection<SortClause> sortClauses)
{
Collections.sort(extensions, new SortClauseComparator(sortClauses));
} | java | public static void sort(List<? extends Extension> extensions, Collection<SortClause> sortClauses)
{
Collections.sort(extensions, new SortClauseComparator(sortClauses));
} | [
"public",
"static",
"void",
"sort",
"(",
"List",
"<",
"?",
"extends",
"Extension",
">",
"extensions",
",",
"Collection",
"<",
"SortClause",
">",
"sortClauses",
")",
"{",
"Collections",
".",
"sort",
"(",
"extensions",
",",
"new",
"SortClauseComparator",
"(",
... | Sort the passed extensions list based on the passed sort clauses.
@param extensions the list of extensions to sort
@param sortClauses the sort clauses
@since 7.0M2 | [
"Sort",
"the",
"passed",
"extensions",
"list",
"based",
"on",
"the",
"passed",
"sort",
"clauses",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L356-L359 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.appendSearchResults | public static <E extends Extension> IterableResult<E> appendSearchResults(IterableResult<E> previousSearchResult,
IterableResult<E> result)
{
AggregatedIterableResult<E> newResult;
if (previousSearchResult instanceof AggregatedIterableResult) {
newResult = ((AggregatedIterableRe... | java | public static <E extends Extension> IterableResult<E> appendSearchResults(IterableResult<E> previousSearchResult,
IterableResult<E> result)
{
AggregatedIterableResult<E> newResult;
if (previousSearchResult instanceof AggregatedIterableResult) {
newResult = ((AggregatedIterableRe... | [
"public",
"static",
"<",
"E",
"extends",
"Extension",
">",
"IterableResult",
"<",
"E",
">",
"appendSearchResults",
"(",
"IterableResult",
"<",
"E",
">",
"previousSearchResult",
",",
"IterableResult",
"<",
"E",
">",
"result",
")",
"{",
"AggregatedIterableResult",
... | Merge provided search results.
@param previousSearchResult all the previous search results
@param result the new search result to append
@return the new aggregated search result
@since 8.1M1
@param <E> the type of element in the {@link Collection} | [
"Merge",
"provided",
"search",
"results",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L370-L387 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.search | public static IterableResult<Extension> search(ExtensionQuery query, Iterable<ExtensionRepository> repositories)
throws SearchException
{
IterableResult<Extension> searchResult = null;
int currentOffset = query.getOffset() > 0 ? query.getOffset() : 0;
int currentNb = query.getLimit(... | java | public static IterableResult<Extension> search(ExtensionQuery query, Iterable<ExtensionRepository> repositories)
throws SearchException
{
IterableResult<Extension> searchResult = null;
int currentOffset = query.getOffset() > 0 ? query.getOffset() : 0;
int currentNb = query.getLimit(... | [
"public",
"static",
"IterableResult",
"<",
"Extension",
">",
"search",
"(",
"ExtensionQuery",
"query",
",",
"Iterable",
"<",
"ExtensionRepository",
">",
"repositories",
")",
"throws",
"SearchException",
"{",
"IterableResult",
"<",
"Extension",
">",
"searchResult",
"... | Search passed repositories based of the provided query.
@param query the query
@param repositories the repositories
@return the found extensions descriptors, empty list if nothing could be found
@throws SearchException error when trying to search provided query
@since 10.0RC1 | [
"Search",
"passed",
"repositories",
"based",
"of",
"the",
"provided",
"query",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L398-L435 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java | RepositoryUtils.search | public static IterableResult<Extension> search(ExtensionRepository repository, ExtensionQuery query,
IterableResult<Extension> previousSearchResult) throws SearchException
{
IterableResult<Extension> result;
if (repository instanceof Searchable) {
if (repository instanceof Advan... | java | public static IterableResult<Extension> search(ExtensionRepository repository, ExtensionQuery query,
IterableResult<Extension> previousSearchResult) throws SearchException
{
IterableResult<Extension> result;
if (repository instanceof Searchable) {
if (repository instanceof Advan... | [
"public",
"static",
"IterableResult",
"<",
"Extension",
">",
"search",
"(",
"ExtensionRepository",
"repository",
",",
"ExtensionQuery",
"query",
",",
"IterableResult",
"<",
"Extension",
">",
"previousSearchResult",
")",
"throws",
"SearchException",
"{",
"IterableResult"... | Search one repository.
@param repository the repository to search
@param query the search query
@param previousSearchResult the current search result merged from all previous repositories
@return the updated maximum number of search results to return
@throws SearchException error while searching on provided repository | [
"Search",
"one",
"repository",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/RepositoryUtils.java#L459-L483 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-display/src/main/java/org/xwiki/diff/display/internal/DefaultUnifiedDiffDisplayer.java | DefaultUnifiedDiffDisplayer.displayInlineDiff | private <E, F> void displayInlineDiff(UnifiedDiffElement<E, F> previous, UnifiedDiffElement<E, F> next,
UnifiedDiffConfiguration<E, F> config)
{
try {
List<F> previousSubElements = config.getSplitter().split(previous.getValue());
List<F> nextSubElements = config.getSplitter()... | java | private <E, F> void displayInlineDiff(UnifiedDiffElement<E, F> previous, UnifiedDiffElement<E, F> next,
UnifiedDiffConfiguration<E, F> config)
{
try {
List<F> previousSubElements = config.getSplitter().split(previous.getValue());
List<F> nextSubElements = config.getSplitter()... | [
"private",
"<",
"E",
",",
"F",
">",
"void",
"displayInlineDiff",
"(",
"UnifiedDiffElement",
"<",
"E",
",",
"F",
">",
"previous",
",",
"UnifiedDiffElement",
"<",
"E",
",",
"F",
">",
"next",
",",
"UnifiedDiffConfiguration",
"<",
"E",
",",
"F",
">",
"config... | Computes the changes between two versions of an element by splitting the element into sub-elements and displays
the result using the in-line format.
@param previous the previous version
@param next the next version version
@param config the configuration for the in-line diff
@param <E> the type of composite elements t... | [
"Computes",
"the",
"changes",
"between",
"two",
"versions",
"of",
"an",
"element",
"by",
"splitting",
"the",
"element",
"into",
"sub",
"-",
"elements",
"and",
"displays",
"the",
"result",
"using",
"the",
"in",
"-",
"line",
"format",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-display/src/main/java/org/xwiki/diff/display/internal/DefaultUnifiedDiffDisplayer.java#L309-L331 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java | AbstractHTMLFilter.filterChildren | protected List<Element> filterChildren(Element parent, String tagName)
{
List<Element> result = new ArrayList<Element>();
Node current = parent.getFirstChild();
while (current != null) {
if (current.getNodeName().equals(tagName)) {
result.add((Element) current);
... | java | protected List<Element> filterChildren(Element parent, String tagName)
{
List<Element> result = new ArrayList<Element>();
Node current = parent.getFirstChild();
while (current != null) {
if (current.getNodeName().equals(tagName)) {
result.add((Element) current);
... | [
"protected",
"List",
"<",
"Element",
">",
"filterChildren",
"(",
"Element",
"parent",
",",
"String",
"tagName",
")",
"{",
"List",
"<",
"Element",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Element",
">",
"(",
")",
";",
"Node",
"current",
"=",
"parent"... | Utility method for filtering an element's children with a tagName.
@param parent the parent {@link Element}.
@param tagName expected tagName of the children elements.
@return list of children elements with the provided tagName. | [
"Utility",
"method",
"for",
"filtering",
"an",
"element",
"s",
"children",
"with",
"a",
"tagName",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java#L45-L56 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java | AbstractHTMLFilter.filterDescendants | protected List<Element> filterDescendants(Element parent, String[] tagNames)
{
List<Element> result = new ArrayList<Element>();
for (String tagName : tagNames) {
NodeList nodes = parent.getElementsByTagName(tagName);
for (int i = 0; i < nodes.getLength(); i++) {
... | java | protected List<Element> filterDescendants(Element parent, String[] tagNames)
{
List<Element> result = new ArrayList<Element>();
for (String tagName : tagNames) {
NodeList nodes = parent.getElementsByTagName(tagName);
for (int i = 0; i < nodes.getLength(); i++) {
... | [
"protected",
"List",
"<",
"Element",
">",
"filterDescendants",
"(",
"Element",
"parent",
",",
"String",
"[",
"]",
"tagNames",
")",
"{",
"List",
"<",
"Element",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Element",
">",
"(",
")",
";",
"for",
"(",
"Str... | Utility method for filtering an element's descendants by their tag names.
@param parent the parent {@link Element}.
@param tagNames an array of tagNames.
@return list of descendants of the parent element having one of given tag names. | [
"Utility",
"method",
"for",
"filtering",
"an",
"element",
"s",
"descendants",
"by",
"their",
"tag",
"names",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java#L65-L76 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java | AbstractHTMLFilter.hasAttribute | protected boolean hasAttribute(List<Element> elements, String attributeName, boolean checkValue)
{
boolean hasAttribute = true;
if (!checkValue) {
for (Element e : elements) {
hasAttribute = e.hasAttribute(attributeName) ? hasAttribute : false;
}
} els... | java | protected boolean hasAttribute(List<Element> elements, String attributeName, boolean checkValue)
{
boolean hasAttribute = true;
if (!checkValue) {
for (Element e : elements) {
hasAttribute = e.hasAttribute(attributeName) ? hasAttribute : false;
}
} els... | [
"protected",
"boolean",
"hasAttribute",
"(",
"List",
"<",
"Element",
">",
"elements",
",",
"String",
"attributeName",
",",
"boolean",
"checkValue",
")",
"{",
"boolean",
"hasAttribute",
"=",
"true",
";",
"if",
"(",
"!",
"checkValue",
")",
"{",
"for",
"(",
"... | Utility method for checking if a list of elements have the same attribute set. If the checkValue is true, the
values of the given attribute will be checked for equivalency.
@param elements the list of elements.
@param attributeName Name of the attribute.
@param checkValue flag indicating if the value of the attribute ... | [
"Utility",
"method",
"for",
"checking",
"if",
"a",
"list",
"of",
"elements",
"have",
"the",
"same",
"attribute",
"set",
".",
"If",
"the",
"checkValue",
"is",
"true",
"the",
"values",
"of",
"the",
"given",
"attribute",
"will",
"be",
"checked",
"for",
"equiv... | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java#L110-L125 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java | AbstractHTMLFilter.moveChildren | protected void moveChildren(Element parent, Element destination)
{
NodeList children = parent.getChildNodes();
while (children.getLength() > 0) {
destination.appendChild(parent.removeChild(parent.getFirstChild()));
}
} | java | protected void moveChildren(Element parent, Element destination)
{
NodeList children = parent.getChildNodes();
while (children.getLength() > 0) {
destination.appendChild(parent.removeChild(parent.getFirstChild()));
}
} | [
"protected",
"void",
"moveChildren",
"(",
"Element",
"parent",
",",
"Element",
"destination",
")",
"{",
"NodeList",
"children",
"=",
"parent",
".",
"getChildNodes",
"(",
")",
";",
"while",
"(",
"children",
".",
"getLength",
"(",
")",
">",
"0",
")",
"{",
... | Moves all child elements of the parent into destination element.
@param parent the parent {@link Element}.
@param destination the destination {@link Element}. | [
"Moves",
"all",
"child",
"elements",
"of",
"the",
"parent",
"into",
"destination",
"element",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java#L147-L153 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDHKeyParameterGenerator.java | BcDHKeyParameterGenerator.getDhParameters | static org.bouncycastle.crypto.params.DHParameters getDhParameters(SecureRandom random,
DHKeyParametersGenerationParameters params)
{
DHParametersGenerator paramGen = new DHParametersGenerator();
paramGen.init(params.getStrength() * 8, params.getCertainty(), random);
return paramGe... | java | static org.bouncycastle.crypto.params.DHParameters getDhParameters(SecureRandom random,
DHKeyParametersGenerationParameters params)
{
DHParametersGenerator paramGen = new DHParametersGenerator();
paramGen.init(params.getStrength() * 8, params.getCertainty(), random);
return paramGe... | [
"static",
"org",
".",
"bouncycastle",
".",
"crypto",
".",
"params",
".",
"DHParameters",
"getDhParameters",
"(",
"SecureRandom",
"random",
",",
"DHKeyParametersGenerationParameters",
"params",
")",
"{",
"DHParametersGenerator",
"paramGen",
"=",
"new",
"DHParametersGener... | Generate DH parameters.
Shared with the key generator to optimize key generation.
@param params the parameters generation parameters.
@return shared DSA parameters for key generation. | [
"Generate",
"DH",
"parameters",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/asymmetric/generator/BcDHKeyParameterGenerator.java#L89-L97 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java | LocalExtensionStorage.loadDescriptor | private DefaultLocalExtension loadDescriptor(File descriptor) throws InvalidExtensionException
{
FileInputStream fis;
try {
fis = new FileInputStream(descriptor);
} catch (FileNotFoundException e) {
throw new InvalidExtensionException("Failed to open descriptor for re... | java | private DefaultLocalExtension loadDescriptor(File descriptor) throws InvalidExtensionException
{
FileInputStream fis;
try {
fis = new FileInputStream(descriptor);
} catch (FileNotFoundException e) {
throw new InvalidExtensionException("Failed to open descriptor for re... | [
"private",
"DefaultLocalExtension",
"loadDescriptor",
"(",
"File",
"descriptor",
")",
"throws",
"InvalidExtensionException",
"{",
"FileInputStream",
"fis",
";",
"try",
"{",
"fis",
"=",
"new",
"FileInputStream",
"(",
"descriptor",
")",
";",
"}",
"catch",
"(",
"File... | Local extension descriptor from a file.
@param descriptor the descriptor file
@return the extension descriptor
@throws InvalidExtensionException error when trying to load extension descriptor | [
"Local",
"extension",
"descriptor",
"from",
"a",
"file",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java#L159-L188 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java | LocalExtensionStorage.getFilePath | private String getFilePath(ExtensionId id, String fileExtension)
{
String encodedId = PathUtils.encode(id.getId());
String encodedVersion = PathUtils.encode(id.getVersion().toString());
String encodedType = PathUtils.encode(fileExtension);
return encodedId + File.separator + encoded... | java | private String getFilePath(ExtensionId id, String fileExtension)
{
String encodedId = PathUtils.encode(id.getId());
String encodedVersion = PathUtils.encode(id.getVersion().toString());
String encodedType = PathUtils.encode(fileExtension);
return encodedId + File.separator + encoded... | [
"private",
"String",
"getFilePath",
"(",
"ExtensionId",
"id",
",",
"String",
"fileExtension",
")",
"{",
"String",
"encodedId",
"=",
"PathUtils",
".",
"encode",
"(",
"id",
".",
"getId",
"(",
")",
")",
";",
"String",
"encodedVersion",
"=",
"PathUtils",
".",
... | Get file path in the local extension repository.
@param id the extension id
@param fileExtension the file extension
@return the encoded file path | [
"Get",
"file",
"path",
"in",
"the",
"local",
"extension",
"repository",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java#L266-L274 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java | LocalExtensionStorage.removeExtension | public void removeExtension(DefaultLocalExtension extension) throws IOException
{
File descriptorFile = extension.getDescriptorFile();
if (descriptorFile == null) {
throw new IOException("Exception does not exists");
}
descriptorFile.delete();
DefaultLocalExten... | java | public void removeExtension(DefaultLocalExtension extension) throws IOException
{
File descriptorFile = extension.getDescriptorFile();
if (descriptorFile == null) {
throw new IOException("Exception does not exists");
}
descriptorFile.delete();
DefaultLocalExten... | [
"public",
"void",
"removeExtension",
"(",
"DefaultLocalExtension",
"extension",
")",
"throws",
"IOException",
"{",
"File",
"descriptorFile",
"=",
"extension",
".",
"getDescriptorFile",
"(",
")",
";",
"if",
"(",
"descriptorFile",
"==",
"null",
")",
"{",
"throw",
... | Remove extension from storage.
@param extension extension to remove
@throws IOException error when deleting the extension | [
"Remove",
"extension",
"from",
"storage",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/local/LocalExtensionStorage.java#L282-L295 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java | DefaultVersion.parse | private void parse()
{
this.elements = new ArrayList<>();
try {
for (Tokenizer tokenizer = new Tokenizer(this.rawVersion); tokenizer.next();) {
Element element = new Element(tokenizer);
this.elements.add(element);
if (element.getVersionTyp... | java | private void parse()
{
this.elements = new ArrayList<>();
try {
for (Tokenizer tokenizer = new Tokenizer(this.rawVersion); tokenizer.next();) {
Element element = new Element(tokenizer);
this.elements.add(element);
if (element.getVersionTyp... | [
"private",
"void",
"parse",
"(",
")",
"{",
"this",
".",
"elements",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"for",
"(",
"Tokenizer",
"tokenizer",
"=",
"new",
"Tokenizer",
"(",
"this",
".",
"rawVersion",
")",
";",
"tokenizer",
".",
"... | Parse the string representation of the version into separated elements. | [
"Parse",
"the",
"string",
"representation",
"of",
"the",
"version",
"into",
"separated",
"elements",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java#L430-L449 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java | DefaultVersion.trimPadding | private static void trimPadding(List<Element> elements)
{
for (ListIterator<Element> it = elements.listIterator(elements.size()); it.hasPrevious();) {
Element element = it.previous();
if (element.compareTo(null) == 0) {
it.remove();
} else {
... | java | private static void trimPadding(List<Element> elements)
{
for (ListIterator<Element> it = elements.listIterator(elements.size()); it.hasPrevious();) {
Element element = it.previous();
if (element.compareTo(null) == 0) {
it.remove();
} else {
... | [
"private",
"static",
"void",
"trimPadding",
"(",
"List",
"<",
"Element",
">",
"elements",
")",
"{",
"for",
"(",
"ListIterator",
"<",
"Element",
">",
"it",
"=",
"elements",
".",
"listIterator",
"(",
"elements",
".",
"size",
"(",
")",
")",
";",
"it",
"."... | Remove empty elements.
@param elements the list of clean | [
"Remove",
"empty",
"elements",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java#L456-L467 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java | DefaultVersion.comparePadding | private static int comparePadding(List<Element> elements, int index, Boolean number)
{
int rel = 0;
for (Iterator<Element> it = elements.listIterator(index); it.hasNext();) {
Element element = it.next();
if (number != null && number.booleanValue() != element.isNumber()) {
... | java | private static int comparePadding(List<Element> elements, int index, Boolean number)
{
int rel = 0;
for (Iterator<Element> it = elements.listIterator(index); it.hasNext();) {
Element element = it.next();
if (number != null && number.booleanValue() != element.isNumber()) {
... | [
"private",
"static",
"int",
"comparePadding",
"(",
"List",
"<",
"Element",
">",
"elements",
",",
"int",
"index",
",",
"Boolean",
"number",
")",
"{",
"int",
"rel",
"=",
"0",
";",
"for",
"(",
"Iterator",
"<",
"Element",
">",
"it",
"=",
"elements",
".",
... | Compare the end of the version with 0.
@param elements the elements to compare to 0
@param index the index where to start comparing with 0
@param number indicate of the previous element is a number
@return the comparison result | [
"Compare",
"the",
"end",
"of",
"the",
"version",
"with",
"0",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java#L616-L633 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionUtils.java | ExtensionUtils.importProperty | public static Collection<String> importProperty(MutableExtension extension, String propertySuffix,
Collection<String> def)
{
Object obj = importProperty(extension, propertySuffix);
if (obj == null) {
return def;
} else if (obj instanceof Collection) {
return ... | java | public static Collection<String> importProperty(MutableExtension extension, String propertySuffix,
Collection<String> def)
{
Object obj = importProperty(extension, propertySuffix);
if (obj == null) {
return def;
} else if (obj instanceof Collection) {
return ... | [
"public",
"static",
"Collection",
"<",
"String",
">",
"importProperty",
"(",
"MutableExtension",
"extension",
",",
"String",
"propertySuffix",
",",
"Collection",
"<",
"String",
">",
"def",
")",
"{",
"Object",
"obj",
"=",
"importProperty",
"(",
"extension",
",",
... | Delete and return the value of the passed special property as a Collection of Strings.
@param extension the extension from which to extract custom property
@param propertySuffix the property suffix
@param def the default value
@return the value or {@code def} if none was found
@since 8.3M1 | [
"Delete",
"and",
"return",
"the",
"value",
"of",
"the",
"passed",
"special",
"property",
"as",
"a",
"Collection",
"of",
"Strings",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionUtils.java#L190-L204 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java | AbstractCache.sendEntryAddedEvent | protected void sendEntryAddedEvent(CacheEntryEvent<T> event)
{
for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
listener.cacheEntryAdded(event);
}
} | java | protected void sendEntryAddedEvent(CacheEntryEvent<T> event)
{
for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
listener.cacheEntryAdded(event);
}
} | [
"protected",
"void",
"sendEntryAddedEvent",
"(",
"CacheEntryEvent",
"<",
"T",
">",
"event",
")",
"{",
"for",
"(",
"org",
".",
"xwiki",
".",
"cache",
".",
"event",
".",
"CacheEntryListener",
"<",
"T",
">",
"listener",
":",
"this",
".",
"cacheEntryListeners",
... | Helper method to send event when a new cache entry is inserted.
@param event the event to send. | [
"Helper",
"method",
"to",
"send",
"event",
"when",
"a",
"new",
"cache",
"entry",
"is",
"inserted",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java#L97-L103 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java | AbstractCache.sendEntryRemovedEvent | protected void sendEntryRemovedEvent(CacheEntryEvent<T> event)
{
for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
listener.cacheEntryRemoved(event);
}
disposeCacheVal... | java | protected void sendEntryRemovedEvent(CacheEntryEvent<T> event)
{
for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
listener.cacheEntryRemoved(event);
}
disposeCacheVal... | [
"protected",
"void",
"sendEntryRemovedEvent",
"(",
"CacheEntryEvent",
"<",
"T",
">",
"event",
")",
"{",
"for",
"(",
"org",
".",
"xwiki",
".",
"cache",
".",
"event",
".",
"CacheEntryListener",
"<",
"T",
">",
"listener",
":",
"this",
".",
"cacheEntryListeners"... | Helper method to send event when an existing cache entry is removed.
@param event the event to send. | [
"Helper",
"method",
"to",
"send",
"event",
"when",
"an",
"existing",
"cache",
"entry",
"is",
"removed",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java#L110-L118 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java | AbstractCache.sendEntryModifiedEvent | protected void sendEntryModifiedEvent(CacheEntryEvent<T> event)
{
for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
listener.cacheEntryModified(event);
}
} | java | protected void sendEntryModifiedEvent(CacheEntryEvent<T> event)
{
for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
listener.cacheEntryModified(event);
}
} | [
"protected",
"void",
"sendEntryModifiedEvent",
"(",
"CacheEntryEvent",
"<",
"T",
">",
"event",
")",
"{",
"for",
"(",
"org",
".",
"xwiki",
".",
"cache",
".",
"event",
".",
"CacheEntryListener",
"<",
"T",
">",
"listener",
":",
"this",
".",
"cacheEntryListeners... | Helper method to send event when a cache entry is modified.
@param event the event to send. | [
"Helper",
"method",
"to",
"send",
"event",
"when",
"a",
"cache",
"entry",
"is",
"modified",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java#L125-L131 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java | AbstractCache.disposeCacheValue | protected void disposeCacheValue(T value)
{
if (value instanceof DisposableCacheValue) {
try {
((DisposableCacheValue) value).dispose();
} catch (Throwable e) {
// We catch Throwable because this method is usually automatically called by an event send ... | java | protected void disposeCacheValue(T value)
{
if (value instanceof DisposableCacheValue) {
try {
((DisposableCacheValue) value).dispose();
} catch (Throwable e) {
// We catch Throwable because this method is usually automatically called by an event send ... | [
"protected",
"void",
"disposeCacheValue",
"(",
"T",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"DisposableCacheValue",
")",
"{",
"try",
"{",
"(",
"(",
"DisposableCacheValue",
")",
"value",
")",
".",
"dispose",
"(",
")",
";",
"}",
"catch",
"(",
... | Dispose the value being removed from the cache.
@param value the value to dispose | [
"Dispose",
"the",
"value",
"being",
"removed",
"from",
"the",
"cache",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-api/src/main/java/org/xwiki/cache/util/AbstractCache.java#L138-L151 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/AbstractBcX509ExtensionBuilder.java | AbstractBcX509ExtensionBuilder.addExtension | public X509ExtensionBuilder addExtension(ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value)
{
try {
this.extensions.addExtension(oid, critical, value.toASN1Primitive().getEncoded(ASN1Encoding.DER));
} catch (IOException e) {
// Very unlikely
throw ne... | java | public X509ExtensionBuilder addExtension(ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value)
{
try {
this.extensions.addExtension(oid, critical, value.toASN1Primitive().getEncoded(ASN1Encoding.DER));
} catch (IOException e) {
// Very unlikely
throw ne... | [
"public",
"X509ExtensionBuilder",
"addExtension",
"(",
"ASN1ObjectIdentifier",
"oid",
",",
"boolean",
"critical",
",",
"ASN1Encodable",
"value",
")",
"{",
"try",
"{",
"this",
".",
"extensions",
".",
"addExtension",
"(",
"oid",
",",
"critical",
",",
"value",
".",... | Add an extension.
@param oid the extension oid.
@param critical true if the extension is critical.
@param value the value of the extension.
@return this extensions builder to allow chaining. | [
"Add",
"an",
"extension",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/extension/AbstractBcX509ExtensionBuilder.java#L86-L95 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java | ExtensionFactory.getVersion | public Version getVersion(String rawVersion)
{
Version version = this.versions.get(rawVersion);
if (version == null) {
version = new DefaultVersion(rawVersion);
this.versions.put(rawVersion, version);
}
return version;
} | java | public Version getVersion(String rawVersion)
{
Version version = this.versions.get(rawVersion);
if (version == null) {
version = new DefaultVersion(rawVersion);
this.versions.put(rawVersion, version);
}
return version;
} | [
"public",
"Version",
"getVersion",
"(",
"String",
"rawVersion",
")",
"{",
"Version",
"version",
"=",
"this",
".",
"versions",
".",
"get",
"(",
"rawVersion",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"version",
"=",
"new",
"DefaultVersion",
... | Store and return a weak reference equals to the passed version.
@param rawVersion the version to find
@return unique instance of {@link VersionConstraint} equals to the passed one | [
"Store",
"and",
"return",
"a",
"weak",
"reference",
"equals",
"to",
"the",
"passed",
"version",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java#L181-L192 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java | ExtensionFactory.getVersionConstraint | public VersionConstraint getVersionConstraint(String rawConstraint)
{
VersionConstraint constraint = this.versionConstrains.get(rawConstraint);
if (constraint == null) {
constraint = new DefaultVersionConstraint(rawConstraint);
this.versionConstrains.put(rawConstraint, cons... | java | public VersionConstraint getVersionConstraint(String rawConstraint)
{
VersionConstraint constraint = this.versionConstrains.get(rawConstraint);
if (constraint == null) {
constraint = new DefaultVersionConstraint(rawConstraint);
this.versionConstrains.put(rawConstraint, cons... | [
"public",
"VersionConstraint",
"getVersionConstraint",
"(",
"String",
"rawConstraint",
")",
"{",
"VersionConstraint",
"constraint",
"=",
"this",
".",
"versionConstrains",
".",
"get",
"(",
"rawConstraint",
")",
";",
"if",
"(",
"constraint",
"==",
"null",
")",
"{",
... | Store and return a weak reference equals to the passed version constraint.
@param rawConstraint the version constraint to find
@return unique instance of {@link VersionConstraint} equals to the passed one | [
"Store",
"and",
"return",
"a",
"weak",
"reference",
"equals",
"to",
"the",
"passed",
"version",
"constraint",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java#L213-L224 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/AbstractBcX509CertificateGenerator.java | AbstractBcX509CertificateGenerator.extendsTBSCertificate | protected void extendsTBSCertificate(BcX509TBSCertificateBuilder builder, CertifiedPublicKey issuer,
PrincipalIndentifier subjectName, PublicKeyParameters subject, X509CertificateParameters parameters)
throws IOException
{
// Do nothing by default.
} | java | protected void extendsTBSCertificate(BcX509TBSCertificateBuilder builder, CertifiedPublicKey issuer,
PrincipalIndentifier subjectName, PublicKeyParameters subject, X509CertificateParameters parameters)
throws IOException
{
// Do nothing by default.
} | [
"protected",
"void",
"extendsTBSCertificate",
"(",
"BcX509TBSCertificateBuilder",
"builder",
",",
"CertifiedPublicKey",
"issuer",
",",
"PrincipalIndentifier",
"subjectName",
",",
"PublicKeyParameters",
"subject",
",",
"X509CertificateParameters",
"parameters",
")",
"throws",
... | Extend TBS certificate depending of certificate version.
@param builder the X.509 TBS certificate builder received from #getTBSCertificateBuilder().
@param issuer the certified public key of the issuer of the certificate, or null for self signed one.
@param subjectName the subject name.
@param subject the subject publ... | [
"Extend",
"TBS",
"certificate",
"depending",
"of",
"certificate",
"version",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/AbstractBcX509CertificateGenerator.java#L89-L94 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/AbstractBcX509CertificateGenerator.java | AbstractBcX509CertificateGenerator.buildTBSCertificate | public TBSCertificate buildTBSCertificate(PrincipalIndentifier subjectName,
PublicKeyParameters subject, X509CertificateParameters parameters) throws IOException
{
PrincipalIndentifier issuerName;
CertifiedPublicKey issuer = null;
if (this.signer instanceof CertifyingSigner) {
... | java | public TBSCertificate buildTBSCertificate(PrincipalIndentifier subjectName,
PublicKeyParameters subject, X509CertificateParameters parameters) throws IOException
{
PrincipalIndentifier issuerName;
CertifiedPublicKey issuer = null;
if (this.signer instanceof CertifyingSigner) {
... | [
"public",
"TBSCertificate",
"buildTBSCertificate",
"(",
"PrincipalIndentifier",
"subjectName",
",",
"PublicKeyParameters",
"subject",
",",
"X509CertificateParameters",
"parameters",
")",
"throws",
"IOException",
"{",
"PrincipalIndentifier",
"issuerName",
";",
"CertifiedPublicKe... | Build the TBS Certificate.
@param subjectName the identifier of the public key owner.
@param subject the public key to certify.
@param parameters the subject parameters for this certificate.
@return the TBS certificate.
@throws IOException on encoding error. | [
"Build",
"the",
"TBS",
"Certificate",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/AbstractBcX509CertificateGenerator.java#L105-L127 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-context/src/main/java/org/xwiki/context/internal/DefaultExecutionContextManager.java | DefaultExecutionContextManager.runInitializers | private void runInitializers(ExecutionContext context) throws ExecutionContextException
{
for (ExecutionContextInitializer initializer : this.initializerProvider.get()) {
initializer.initialize(context);
}
} | java | private void runInitializers(ExecutionContext context) throws ExecutionContextException
{
for (ExecutionContextInitializer initializer : this.initializerProvider.get()) {
initializer.initialize(context);
}
} | [
"private",
"void",
"runInitializers",
"(",
"ExecutionContext",
"context",
")",
"throws",
"ExecutionContextException",
"{",
"for",
"(",
"ExecutionContextInitializer",
"initializer",
":",
"this",
".",
"initializerProvider",
".",
"get",
"(",
")",
")",
"{",
"initializer",... | Run the initializers.
@param context the execution context to initialize
@throws ExecutionContextException in case one {@link ExecutionContextInitializer} fails to execute | [
"Run",
"the",
"initializers",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-context/src/main/java/org/xwiki/context/internal/DefaultExecutionContextManager.java#L112-L117 | train |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/xwiki-commons-legacy-component-default/src/main/java/org/xwiki/component/annotation/RequirementComponentDependencyFactory.java | RequirementComponentDependencyFactory.getFieldRole | private Class<?> getFieldRole(Field field, Requirement requirement)
{
Class<?> role;
// Handle case of list or map
if (isDependencyOfListType(field.getType())) {
role = getGenericRole(field);
} else {
role = field.getType();
}
return role;
... | java | private Class<?> getFieldRole(Field field, Requirement requirement)
{
Class<?> role;
// Handle case of list or map
if (isDependencyOfListType(field.getType())) {
role = getGenericRole(field);
} else {
role = field.getType();
}
return role;
... | [
"private",
"Class",
"<",
"?",
">",
"getFieldRole",
"(",
"Field",
"field",
",",
"Requirement",
"requirement",
")",
"{",
"Class",
"<",
"?",
">",
"role",
";",
"// Handle case of list or map",
"if",
"(",
"isDependencyOfListType",
"(",
"field",
".",
"getType",
"(",... | Extract component role from the field to inject.
@param field the field to inject
@param requirement the Requirement attribute
@return the role of the field to inject | [
"Extract",
"component",
"role",
"from",
"the",
"field",
"to",
"inject",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/xwiki-commons-legacy-component-default/src/main/java/org/xwiki/component/annotation/RequirementComponentDependencyFactory.java#L75-L87 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.