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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/RunWithinInterceptionDecorationContextGenerator.java | RunWithinInterceptionDecorationContextGenerator.endIfStarted | void endIfStarted(CodeAttribute b, ClassMethod method) {
b.aload(getLocalVariableIndex(0));
b.dup();
final BranchEnd ifnotnull = b.ifnull();
b.checkcast(Stack.class);
b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRI... | java | void endIfStarted(CodeAttribute b, ClassMethod method) {
b.aload(getLocalVariableIndex(0));
b.dup();
final BranchEnd ifnotnull = b.ifnull();
b.checkcast(Stack.class);
b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRI... | [
"void",
"endIfStarted",
"(",
"CodeAttribute",
"b",
",",
"ClassMethod",
"method",
")",
"{",
"b",
".",
"aload",
"(",
"getLocalVariableIndex",
"(",
"0",
")",
")",
";",
"b",
".",
"dup",
"(",
")",
";",
"final",
"BranchEnd",
"ifnotnull",
"=",
"b",
".",
"ifnu... | Ends interception context if it was previously stated. This is indicated by a local variable with index 0. | [
"Ends",
"interception",
"context",
"if",
"it",
"was",
"previously",
"stated",
".",
"This",
"is",
"indicated",
"by",
"a",
"local",
"variable",
"with",
"index",
"0",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/RunWithinInterceptionDecorationContextGenerator.java#L117-L127 | train |
weld/core | impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java | AbstractContext.get | @Override
@SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "False positive from FindBugs")
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
checkContextInitialized... | java | @Override
@SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "False positive from FindBugs")
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
checkContextInitialized... | [
"@",
"Override",
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"UL_UNRELEASED_LOCK\"",
",",
"justification",
"=",
"\"False positive from FindBugs\"",
")",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"CreationalContex... | Get the bean if it exists in the contexts.
@return An instance of the bean
@throws ContextNotActiveException if the context is not active
@see javax.enterprise.context.spi.Context#get(BaseBean, boolean) | [
"Get",
"the",
"bean",
"if",
"it",
"exists",
"in",
"the",
"contexts",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java#L68-L110 | train |
weld/core | impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java | AbstractContext.destroy | protected void destroy() {
ContextLogger.LOG.contextCleared(this);
final BeanStore beanStore = getBeanStore();
if (beanStore == null) {
throw ContextLogger.LOG.noBeanStoreAvailable(this);
}
for (BeanIdentifier id : beanStore) {
destroyContextualInstance(be... | java | protected void destroy() {
ContextLogger.LOG.contextCleared(this);
final BeanStore beanStore = getBeanStore();
if (beanStore == null) {
throw ContextLogger.LOG.noBeanStoreAvailable(this);
}
for (BeanIdentifier id : beanStore) {
destroyContextualInstance(be... | [
"protected",
"void",
"destroy",
"(",
")",
"{",
"ContextLogger",
".",
"LOG",
".",
"contextCleared",
"(",
"this",
")",
";",
"final",
"BeanStore",
"beanStore",
"=",
"getBeanStore",
"(",
")",
";",
"if",
"(",
"beanStore",
"==",
"null",
")",
"{",
"throw",
"Con... | Destroys the context | [
"Destroys",
"the",
"context"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/AbstractContext.java#L146-L156 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/Iterables.java | Iterables.addAll | public static <T> boolean addAll(Collection<T> target, Iterable<? extends T> iterable) {
if (iterable instanceof Collection) {
return target.addAll((Collection<? extends T>) iterable);
}
return Iterators.addAll(target, iterable.iterator());
} | java | public static <T> boolean addAll(Collection<T> target, Iterable<? extends T> iterable) {
if (iterable instanceof Collection) {
return target.addAll((Collection<? extends T>) iterable);
}
return Iterators.addAll(target, iterable.iterator());
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"target",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"Collection",
")",
"{",
"return",
"target",
"... | Add all elements in the iterable to the collection.
@param target
@param iterable
@return true if the target was modified, false otherwise | [
"Add",
"all",
"elements",
"in",
"the",
"iterable",
"to",
"the",
"collection",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/Iterables.java#L41-L46 | train |
weld/core | impl/src/main/java/org/jboss/weld/manager/FieldProducerFactory.java | FieldProducerFactory.createProducer | @Override
public <T> Producer<T> createProducer(final Bean<X> declaringBean, final Bean<T> bean, DisposalMethod<X, T> disposalMethod) {
EnhancedAnnotatedField<T, X> enhancedField = getManager().getServices().get(MemberTransformer.class).loadEnhancedMember(field, getManager().getId());
return new Pro... | java | @Override
public <T> Producer<T> createProducer(final Bean<X> declaringBean, final Bean<T> bean, DisposalMethod<X, T> disposalMethod) {
EnhancedAnnotatedField<T, X> enhancedField = getManager().getServices().get(MemberTransformer.class).loadEnhancedMember(field, getManager().getId());
return new Pro... | [
"@",
"Override",
"public",
"<",
"T",
">",
"Producer",
"<",
"T",
">",
"createProducer",
"(",
"final",
"Bean",
"<",
"X",
">",
"declaringBean",
",",
"final",
"Bean",
"<",
"T",
">",
"bean",
",",
"DisposalMethod",
"<",
"X",
",",
"T",
">",
"disposalMethod",
... | Producers returned from this method are not validated. Internal use only. | [
"Producers",
"returned",
"from",
"this",
"method",
"are",
"not",
"validated",
".",
"Internal",
"use",
"only",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/manager/FieldProducerFactory.java#L43-L68 | train |
weld/core | environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java | WeldDeployment.createAdditionalBeanDeploymentArchive | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive(ADDITIONAL_BDA_ID, Collections.synchronizedSet(new HashSet<String>()), null);
additionalBda.getServices().addAll(getServices().entrySet());
beanDe... | java | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive(ADDITIONAL_BDA_ID, Collections.synchronizedSet(new HashSet<String>()), null);
additionalBda.getServices().addAll(getServices().entrySet());
beanDe... | [
"protected",
"WeldBeanDeploymentArchive",
"createAdditionalBeanDeploymentArchive",
"(",
")",
"{",
"WeldBeanDeploymentArchive",
"additionalBda",
"=",
"new",
"WeldBeanDeploymentArchive",
"(",
"ADDITIONAL_BDA_ID",
",",
"Collections",
".",
"synchronizedSet",
"(",
"new",
"HashSet",
... | Additional bean deployment archives are used for extentions, synthetic annotated types and beans which do not come from a bean archive.
@param beanClass
@return the additional bean deployment archive | [
"Additional",
"bean",
"deployment",
"archives",
"are",
"used",
"for",
"extentions",
"synthetic",
"annotated",
"types",
"and",
"beans",
"which",
"do",
"not",
"come",
"from",
"a",
"bean",
"archive",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java#L104-L110 | train |
weld/core | environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java | WeldDeployment.setBeanDeploymentArchivesAccessibility | protected void setBeanDeploymentArchivesAccessibility() {
for (WeldBeanDeploymentArchive beanDeploymentArchive : beanDeploymentArchives) {
Set<WeldBeanDeploymentArchive> accessibleArchives = new HashSet<>();
for (WeldBeanDeploymentArchive candidate : beanDeploymentArchives) {
... | java | protected void setBeanDeploymentArchivesAccessibility() {
for (WeldBeanDeploymentArchive beanDeploymentArchive : beanDeploymentArchives) {
Set<WeldBeanDeploymentArchive> accessibleArchives = new HashSet<>();
for (WeldBeanDeploymentArchive candidate : beanDeploymentArchives) {
... | [
"protected",
"void",
"setBeanDeploymentArchivesAccessibility",
"(",
")",
"{",
"for",
"(",
"WeldBeanDeploymentArchive",
"beanDeploymentArchive",
":",
"beanDeploymentArchives",
")",
"{",
"Set",
"<",
"WeldBeanDeploymentArchive",
">",
"accessibleArchives",
"=",
"new",
"HashSet"... | By default all bean archives see each other. | [
"By",
"default",
"all",
"bean",
"archives",
"see",
"each",
"other",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java#L115-L126 | train |
weld/core | probe/core/src/main/java/org/jboss/weld/probe/Parsers.java | Parsers.parseType | static Type parseType(String value, ResourceLoader resourceLoader) {
value = value.trim();
// Wildcards
if (value.equals(WILDCARD)) {
return WildcardTypeImpl.defaultInstance();
}
if (value.startsWith(WILDCARD_EXTENDS)) {
Type upperBound = parseType(value.s... | java | static Type parseType(String value, ResourceLoader resourceLoader) {
value = value.trim();
// Wildcards
if (value.equals(WILDCARD)) {
return WildcardTypeImpl.defaultInstance();
}
if (value.startsWith(WILDCARD_EXTENDS)) {
Type upperBound = parseType(value.s... | [
"static",
"Type",
"parseType",
"(",
"String",
"value",
",",
"ResourceLoader",
"resourceLoader",
")",
"{",
"value",
"=",
"value",
".",
"trim",
"(",
")",
";",
"// Wildcards",
"if",
"(",
"value",
".",
"equals",
"(",
"WILDCARD",
")",
")",
"{",
"return",
"Wil... | Type variables are not supported.
@param value
@return the type | [
"Type",
"variables",
"are",
"not",
"supported",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/probe/core/src/main/java/org/jboss/weld/probe/Parsers.java#L70-L122 | train |
weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java | PortletSupport.isPortletEnvSupported | public static boolean isPortletEnvSupported() {
if (enabled == null) {
synchronized (PortletSupport.class) {
if (enabled == null) {
try {
PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext");
... | java | public static boolean isPortletEnvSupported() {
if (enabled == null) {
synchronized (PortletSupport.class) {
if (enabled == null) {
try {
PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext");
... | [
"public",
"static",
"boolean",
"isPortletEnvSupported",
"(",
")",
"{",
"if",
"(",
"enabled",
"==",
"null",
")",
"{",
"synchronized",
"(",
"PortletSupport",
".",
"class",
")",
"{",
"if",
"(",
"enabled",
"==",
"null",
")",
"{",
"try",
"{",
"PortletSupport",
... | Is portlet env supported.
@return true if portlet env is supported, false otherwise | [
"Is",
"portlet",
"env",
"supported",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java#L40-L54 | train |
weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java | PortletSupport.getBeanManager | public static BeanManager getBeanManager(Object ctx) {
return (BeanManager) javax.portlet.PortletContext.class.cast(ctx).getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
} | java | public static BeanManager getBeanManager(Object ctx) {
return (BeanManager) javax.portlet.PortletContext.class.cast(ctx).getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
} | [
"public",
"static",
"BeanManager",
"getBeanManager",
"(",
"Object",
"ctx",
")",
"{",
"return",
"(",
"BeanManager",
")",
"javax",
".",
"portlet",
".",
"PortletContext",
".",
"class",
".",
"cast",
"(",
"ctx",
")",
".",
"getAttribute",
"(",
"WeldServletLifecycle"... | Get bean manager from portlet context.
@param ctx the portlet context
@return bean manager if found | [
"Get",
"bean",
"manager",
"from",
"portlet",
"context",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/portlet/PortletSupport.java#L72-L74 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/enablement/GlobalEnablementBuilder.java | GlobalEnablementBuilder.filter | private <T> List<Class<?>> filter(List<Class<?>> enabledClasses, List<Class<?>> globallyEnabledClasses, LogMessageCallback logMessageCallback,
BeanDeployment deployment) {
for (Iterator<Class<?>> iterator = enabledClasses.iterator(); iterator.hasNext(); ) {
Class<?> enabledClass = iterat... | java | private <T> List<Class<?>> filter(List<Class<?>> enabledClasses, List<Class<?>> globallyEnabledClasses, LogMessageCallback logMessageCallback,
BeanDeployment deployment) {
for (Iterator<Class<?>> iterator = enabledClasses.iterator(); iterator.hasNext(); ) {
Class<?> enabledClass = iterat... | [
"private",
"<",
"T",
">",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"filter",
"(",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"enabledClasses",
",",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"globallyEnabledClasses",
",",
"LogMessageCallback",
"logMessa... | Filter out interceptors and decorators which are also enabled globally.
@param enabledClasses
@param globallyEnabledClasses
@param logMessageCallback
@param deployment
@return the filtered list | [
"Filter",
"out",
"interceptors",
"and",
"decorators",
"which",
"are",
"also",
"enabled",
"globally",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/enablement/GlobalEnablementBuilder.java#L270-L280 | train |
weld/core | impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java | TypeSafeResolver.resolve | public F resolve(R resolvable, boolean cache) {
R wrappedResolvable = wrap(resolvable);
if (cache) {
return resolved.getValue(wrappedResolvable);
} else {
return resolverFunction.apply(wrappedResolvable);
}
} | java | public F resolve(R resolvable, boolean cache) {
R wrappedResolvable = wrap(resolvable);
if (cache) {
return resolved.getValue(wrappedResolvable);
} else {
return resolverFunction.apply(wrappedResolvable);
}
} | [
"public",
"F",
"resolve",
"(",
"R",
"resolvable",
",",
"boolean",
"cache",
")",
"{",
"R",
"wrappedResolvable",
"=",
"wrap",
"(",
"resolvable",
")",
";",
"if",
"(",
"cache",
")",
"{",
"return",
"resolved",
".",
"getValue",
"(",
"wrappedResolvable",
")",
"... | Get the possible beans for the given element
@param resolvable The resolving criteria
@return An unmodifiable set of matching beans | [
"Get",
"the",
"possible",
"beans",
"for",
"the",
"given",
"element"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java#L85-L92 | train |
weld/core | impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java | TypeSafeResolver.findMatching | private Set<T> findMatching(R resolvable) {
Set<T> result = new HashSet<T>();
for (T bean : getAllBeans(resolvable)) {
if (matches(resolvable, bean)) {
result.add(bean);
}
}
return result;
} | java | private Set<T> findMatching(R resolvable) {
Set<T> result = new HashSet<T>();
for (T bean : getAllBeans(resolvable)) {
if (matches(resolvable, bean)) {
result.add(bean);
}
}
return result;
} | [
"private",
"Set",
"<",
"T",
">",
"findMatching",
"(",
"R",
"resolvable",
")",
"{",
"Set",
"<",
"T",
">",
"result",
"=",
"new",
"HashSet",
"<",
"T",
">",
"(",
")",
";",
"for",
"(",
"T",
"bean",
":",
"getAllBeans",
"(",
"resolvable",
")",
")",
"{",... | Gets the matching beans for binding criteria from a list of beans
@param resolvable the resolvable
@return A set of filtered beans | [
"Gets",
"the",
"matching",
"beans",
"for",
"binding",
"criteria",
"from",
"a",
"list",
"of",
"beans"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/TypeSafeResolver.java#L100-L108 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java | BeanDeployerEnvironment.resolveDisposalBeans | public <X> Set<DisposalMethod<X, ?>> resolveDisposalBeans(Set<Type> types, Set<Annotation> qualifiers, AbstractClassBean<X> declaringBean) {
// We can always cache as this is only ever called by Weld where we avoid non-static inner classes for annotation literals
Set<DisposalMethod<X, ?>> beans = cast(d... | java | public <X> Set<DisposalMethod<X, ?>> resolveDisposalBeans(Set<Type> types, Set<Annotation> qualifiers, AbstractClassBean<X> declaringBean) {
// We can always cache as this is only ever called by Weld where we avoid non-static inner classes for annotation literals
Set<DisposalMethod<X, ?>> beans = cast(d... | [
"public",
"<",
"X",
">",
"Set",
"<",
"DisposalMethod",
"<",
"X",
",",
"?",
">",
">",
"resolveDisposalBeans",
"(",
"Set",
"<",
"Type",
">",
"types",
",",
"Set",
"<",
"Annotation",
">",
"qualifiers",
",",
"AbstractClassBean",
"<",
"X",
">",
"declaringBean"... | Resolve the disposal method for the given producer method. Any resolved
beans will be marked as such for the purpose of validating that all
disposal methods are used. For internal use.
@param types the types
@param qualifiers The binding types to match
@param declaringBean declaring bean
@return The set of matching di... | [
"Resolve",
"the",
"disposal",
"method",
"for",
"the",
"given",
"producer",
"method",
".",
"Any",
"resolved",
"beans",
"will",
"be",
"marked",
"as",
"such",
"for",
"the",
"purpose",
"of",
"validating",
"that",
"all",
"disposal",
"methods",
"are",
"used",
".",... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java#L297-L302 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeans.java | SessionBeans.getSessionBeanTypes | private static <T> Set<Type> getSessionBeanTypes(EnhancedAnnotated<T, ?> annotated, EjbDescriptor<T> ejbDescriptor) {
ImmutableSet.Builder<Type> types = ImmutableSet.builder();
// session beans
Map<Class<?>, Type> typeMap = new LinkedHashMap<Class<?>, Type>();
HierarchyDiscovery beanClas... | java | private static <T> Set<Type> getSessionBeanTypes(EnhancedAnnotated<T, ?> annotated, EjbDescriptor<T> ejbDescriptor) {
ImmutableSet.Builder<Type> types = ImmutableSet.builder();
// session beans
Map<Class<?>, Type> typeMap = new LinkedHashMap<Class<?>, Type>();
HierarchyDiscovery beanClas... | [
"private",
"static",
"<",
"T",
">",
"Set",
"<",
"Type",
">",
"getSessionBeanTypes",
"(",
"EnhancedAnnotated",
"<",
"T",
",",
"?",
">",
"annotated",
",",
"EjbDescriptor",
"<",
"T",
">",
"ejbDescriptor",
")",
"{",
"ImmutableSet",
".",
"Builder",
"<",
"Type",... | Bean types of a session bean. | [
"Bean",
"types",
"of",
"a",
"session",
"bean",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeans.java#L125-L153 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.of | public static <T> SessionBean<T> of(BeanAttributes<T> attributes, InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, EnhancedAnnotatedType<T> type) {
return new SessionBeanImpl<T>(attributes, type, ejbDescriptor, new StringBeanIdentifier(SessionBeans.createIdentifier(type, ejbDescriptor)), bea... | java | public static <T> SessionBean<T> of(BeanAttributes<T> attributes, InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, EnhancedAnnotatedType<T> type) {
return new SessionBeanImpl<T>(attributes, type, ejbDescriptor, new StringBeanIdentifier(SessionBeans.createIdentifier(type, ejbDescriptor)), bea... | [
"public",
"static",
"<",
"T",
">",
"SessionBean",
"<",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"InternalEjbDescriptor",
"<",
"T",
">",
"ejbDescriptor",
",",
"BeanManagerImpl",
"beanManager",
",",
"EnhancedAnnotatedType",
"<",
"... | Creates a simple, annotation defined Enterprise Web Bean using the annotations specified on type
@param <T> The type
@param beanManager the current manager
@param type the AnnotatedType to use
@return An Enterprise Web Bean | [
"Creates",
"a",
"simple",
"annotation",
"defined",
"Enterprise",
"Web",
"Bean",
"using",
"the",
"annotations",
"specified",
"on",
"type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L76-L78 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.checkConflictingRoles | protected void checkConflictingRoles() {
if (getType().isAnnotationPresent(Interceptor.class)) {
throw BeanLogger.LOG.ejbCannotBeInterceptor(getType());
}
if (getType().isAnnotationPresent(Decorator.class)) {
throw BeanLogger.LOG.ejbCannotBeDecorator(getType());
}... | java | protected void checkConflictingRoles() {
if (getType().isAnnotationPresent(Interceptor.class)) {
throw BeanLogger.LOG.ejbCannotBeInterceptor(getType());
}
if (getType().isAnnotationPresent(Decorator.class)) {
throw BeanLogger.LOG.ejbCannotBeDecorator(getType());
}... | [
"protected",
"void",
"checkConflictingRoles",
"(",
")",
"{",
"if",
"(",
"getType",
"(",
")",
".",
"isAnnotationPresent",
"(",
"Interceptor",
".",
"class",
")",
")",
"{",
"throw",
"BeanLogger",
".",
"LOG",
".",
"ejbCannotBeInterceptor",
"(",
"getType",
"(",
"... | Validates for non-conflicting roles | [
"Validates",
"for",
"non",
"-",
"conflicting",
"roles"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L107-L114 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.checkScopeAllowed | protected void checkScopeAllowed() {
if (ejbDescriptor.isStateless() && !isDependent()) {
throw BeanLogger.LOG.scopeNotAllowedOnStatelessSessionBean(getScope(), getType());
}
if (ejbDescriptor.isSingleton() && !(isDependent() || getScope().equals(ApplicationScoped.class))) {
... | java | protected void checkScopeAllowed() {
if (ejbDescriptor.isStateless() && !isDependent()) {
throw BeanLogger.LOG.scopeNotAllowedOnStatelessSessionBean(getScope(), getType());
}
if (ejbDescriptor.isSingleton() && !(isDependent() || getScope().equals(ApplicationScoped.class))) {
... | [
"protected",
"void",
"checkScopeAllowed",
"(",
")",
"{",
"if",
"(",
"ejbDescriptor",
".",
"isStateless",
"(",
")",
"&&",
"!",
"isDependent",
"(",
")",
")",
"{",
"throw",
"BeanLogger",
".",
"LOG",
".",
"scopeNotAllowedOnStatelessSessionBean",
"(",
"getScope",
"... | Check that the scope type is allowed by the stereotypes on the bean and
the bean type | [
"Check",
"that",
"the",
"scope",
"type",
"is",
"allowed",
"by",
"the",
"stereotypes",
"on",
"the",
"bean",
"and",
"the",
"bean",
"type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L120-L127 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java | SessionBeanImpl.checkObserverMethods | protected void checkObserverMethods() {
Collection<EnhancedAnnotatedMethod<?, ? super T>> observerMethods = BeanMethods.getObserverMethods(this.getEnhancedAnnotated());
Collection<EnhancedAnnotatedMethod<?, ? super T>> asyncObserverMethods = BeanMethods.getAsyncObserverMethods(this.getEnhancedAnnotated(... | java | protected void checkObserverMethods() {
Collection<EnhancedAnnotatedMethod<?, ? super T>> observerMethods = BeanMethods.getObserverMethods(this.getEnhancedAnnotated());
Collection<EnhancedAnnotatedMethod<?, ? super T>> asyncObserverMethods = BeanMethods.getAsyncObserverMethods(this.getEnhancedAnnotated(... | [
"protected",
"void",
"checkObserverMethods",
"(",
")",
"{",
"Collection",
"<",
"EnhancedAnnotatedMethod",
"<",
"?",
",",
"?",
"super",
"T",
">",
">",
"observerMethods",
"=",
"BeanMethods",
".",
"getObserverMethods",
"(",
"this",
".",
"getEnhancedAnnotated",
"(",
... | If there are any observer methods, they must be static or business
methods. | [
"If",
"there",
"are",
"any",
"observer",
"methods",
"they",
"must",
"be",
"static",
"or",
"business",
"methods",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/SessionBeanImpl.java#L203-L208 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java | NewManagedBean.of | public static <T> NewManagedBean<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
return new NewManagedBean<T>(attributes, clazz, new StringBeanIdentifier(BeanIdentifiers.forNewManagedBean(clazz)), beanManager);
} | java | public static <T> NewManagedBean<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
return new NewManagedBean<T>(attributes, clazz, new StringBeanIdentifier(BeanIdentifiers.forNewManagedBean(clazz)), beanManager);
} | [
"public",
"static",
"<",
"T",
">",
"NewManagedBean",
"<",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"EnhancedAnnotatedType",
"<",
"T",
">",
"clazz",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"return",
"new",
"NewManagedB... | Creates an instance of a NewSimpleBean from an annotated class
@param clazz The annotated class
@param beanManager The Bean manager
@return a new NewSimpleBean instance | [
"Creates",
"an",
"instance",
"of",
"a",
"NewSimpleBean",
"from",
"an",
"annotated",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java#L39-L41 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/EnterpriseBeanProxyMethodHandler.java | EnterpriseBeanProxyMethodHandler.invoke | @Override
public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable {
if ("destroy".equals(method.getName()) && Marker.isMarker(0, method, args)) {
if (bean.getEjbDescriptor().isStateful()) {
if (!reference.isRemoved()) {
... | java | @Override
public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable {
if ("destroy".equals(method.getName()) && Marker.isMarker(0, method, args)) {
if (bean.getEjbDescriptor().isStateful()) {
if (!reference.isRemoved()) {
... | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"Object",
"self",
",",
"Method",
"method",
",",
"Method",
"proceed",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"\"destroy\"",
".",
"equals",
"(",
"method",
".",
"getNa... | Looks up the EJB in the container and executes the method on it
@param self the proxy instance.
@param method the overridden method declared in the super class or
interface.
@param proceed the forwarder method for invoking the overridden method. It
is null if the overridden method is abstract or declared in the
in... | [
"Looks",
"up",
"the",
"EJB",
"in",
"the",
"container",
"and",
"executes",
"the",
"method",
"on",
"it"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/EnterpriseBeanProxyMethodHandler.java#L111-L137 | train |
weld/core | modules/jta/src/main/java/org/jboss/weld/module/jta/TransactionalObserverNotifier.java | TransactionalObserverNotifier.deferNotification | private <T> void deferNotification(T event, final EventMetadata metadata, final ObserverMethod<? super T> observer,
final List<DeferredEventNotification<?>> notifications) {
TransactionPhase transactionPhase = observer.getTransactionPhase();
boolean before = transactionPhase.equals(Transacti... | java | private <T> void deferNotification(T event, final EventMetadata metadata, final ObserverMethod<? super T> observer,
final List<DeferredEventNotification<?>> notifications) {
TransactionPhase transactionPhase = observer.getTransactionPhase();
boolean before = transactionPhase.equals(Transacti... | [
"private",
"<",
"T",
">",
"void",
"deferNotification",
"(",
"T",
"event",
",",
"final",
"EventMetadata",
"metadata",
",",
"final",
"ObserverMethod",
"<",
"?",
"super",
"T",
">",
"observer",
",",
"final",
"List",
"<",
"DeferredEventNotification",
"<",
"?",
">... | Defers an event for processing in a later phase of the current
transaction.
@param metadata The event object | [
"Defers",
"an",
"event",
"for",
"processing",
"in",
"a",
"later",
"phase",
"of",
"the",
"current",
"transaction",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/jta/src/main/java/org/jboss/weld/module/jta/TransactionalObserverNotifier.java#L63-L69 | train |
weld/core | impl/src/main/java/org/jboss/weld/serialization/BeanIdentifierIndex.java | BeanIdentifierIndex.build | public void build(Set<Bean<?>> beans) {
if (isBuilt()) {
throw new IllegalStateException("BeanIdentifier index is already built!");
}
if (beans.isEmpty()) {
index = new BeanIdentifier[0];
reverseIndex = Collections.emptyMap();
indexHash = 0;
... | java | public void build(Set<Bean<?>> beans) {
if (isBuilt()) {
throw new IllegalStateException("BeanIdentifier index is already built!");
}
if (beans.isEmpty()) {
index = new BeanIdentifier[0];
reverseIndex = Collections.emptyMap();
indexHash = 0;
... | [
"public",
"void",
"build",
"(",
"Set",
"<",
"Bean",
"<",
"?",
">",
">",
"beans",
")",
"{",
"if",
"(",
"isBuilt",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"BeanIdentifier index is already built!\"",
")",
";",
"}",
"if",
"(",
"be... | Note that the index can only be built once.
@param beans The set of beans the index should be built from, only instances of {@link CommonBean} and implementations of {@link PassivationCapable} are
included
@throws IllegalStateException If the index is built already | [
"Note",
"that",
"the",
"index",
"can",
"only",
"be",
"built",
"once",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/serialization/BeanIdentifierIndex.java#L100-L145 | train |
weld/core | impl/src/main/java/org/jboss/weld/event/FastEvent.java | FastEvent.of | public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers) {
ResolvedObservers<T> resolvedObserverMethods = notifier.<T> resolveObserverMethods(type, qualifiers);
if (resolvedObserverMethods.isMetadataRequired()) {
EventMeta... | java | public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers) {
ResolvedObservers<T> resolvedObserverMethods = notifier.<T> resolveObserverMethods(type, qualifiers);
if (resolvedObserverMethods.isMetadataRequired()) {
EventMeta... | [
"public",
"static",
"<",
"T",
">",
"FastEvent",
"<",
"T",
">",
"of",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"BeanManagerImpl",
"manager",
",",
"ObserverNotifier",
"notifier",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"ResolvedObservers",
"<",
"T... | Constructs a new FastEvent instance
@param type the event type
@param manager the bean manager
@param notifier the notifier to be used for observer method resolution
@param qualifiers the event qualifiers
@return | [
"Constructs",
"a",
"new",
"FastEvent",
"instance"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/event/FastEvent.java#L75-L84 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java | ImmutableList.copyOf | public static <T> List<T> copyOf(T[] elements) {
Preconditions.checkNotNull(elements);
return ofInternal(elements.clone());
} | java | public static <T> List<T> copyOf(T[] elements) {
Preconditions.checkNotNull(elements);
return ofInternal(elements.clone());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"copyOf",
"(",
"T",
"[",
"]",
"elements",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"elements",
")",
";",
"return",
"ofInternal",
"(",
"elements",
".",
"clone",
"(",
")",
")",
";",
... | Creates an immutable list that consists of the elements in the given array. A copy of the given array is used which means
that any modifications to the given array will not affect the immutable list.
@param elements the given array of elements
@return an immutable list | [
"Creates",
"an",
"immutable",
"list",
"that",
"consists",
"of",
"the",
"elements",
"in",
"the",
"given",
"array",
".",
"A",
"copy",
"of",
"the",
"given",
"array",
"is",
"used",
"which",
"means",
"that",
"any",
"modifications",
"to",
"the",
"given",
"array"... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java#L66-L69 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java | ImmutableList.copyOf | public static <T> List<T> copyOf(Collection<T> source) {
Preconditions.checkNotNull(source);
if (source instanceof ImmutableList<?>) {
return (ImmutableList<T>) source;
}
if (source.isEmpty()) {
return Collections.emptyList();
}
return ofInternal(s... | java | public static <T> List<T> copyOf(Collection<T> source) {
Preconditions.checkNotNull(source);
if (source instanceof ImmutableList<?>) {
return (ImmutableList<T>) source;
}
if (source.isEmpty()) {
return Collections.emptyList();
}
return ofInternal(s... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"copyOf",
"(",
"Collection",
"<",
"T",
">",
"source",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"source",
")",
";",
"if",
"(",
"source",
"instanceof",
"ImmutableList",
"<",
"?",
">",
... | Creates an immutable list that consists of the elements in the given collection. If the given collection is already an immutable list,
it is returned directly.
@param source the given collection
@return an immutable list | [
"Creates",
"an",
"immutable",
"list",
"that",
"consists",
"of",
"the",
"elements",
"in",
"the",
"given",
"collection",
".",
"If",
"the",
"given",
"collection",
"is",
"already",
"an",
"immutable",
"list",
"it",
"is",
"returned",
"directly",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableList.java#L78-L87 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Interceptors.java | Interceptors.filterInterceptorBindings | public static Set<Annotation> filterInterceptorBindings(BeanManagerImpl beanManager, Collection<Annotation> annotations) {
Set<Annotation> interceptorBindings = new InterceptorBindingSet(beanManager);
for (Annotation annotation : annotations) {
if (beanManager.isInterceptorBinding(annotation... | java | public static Set<Annotation> filterInterceptorBindings(BeanManagerImpl beanManager, Collection<Annotation> annotations) {
Set<Annotation> interceptorBindings = new InterceptorBindingSet(beanManager);
for (Annotation annotation : annotations) {
if (beanManager.isInterceptorBinding(annotation... | [
"public",
"static",
"Set",
"<",
"Annotation",
">",
"filterInterceptorBindings",
"(",
"BeanManagerImpl",
"beanManager",
",",
"Collection",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"Set",
"<",
"Annotation",
">",
"interceptorBindings",
"=",
"new",
"InterceptorB... | Extracts a set of interceptor bindings from a collection of annotations.
@param beanManager
@param annotations
@return | [
"Extracts",
"a",
"set",
"of",
"interceptor",
"bindings",
"from",
"a",
"collection",
"of",
"annotations",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Interceptors.java#L54-L62 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Interceptors.java | Interceptors.flattenInterceptorBindings | public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings,
boolean addInheritedInterceptorBindings) {
Set<Annotation> flattenInterceptorBindings = new InterceptorBin... | java | public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings,
boolean addInheritedInterceptorBindings) {
Set<Annotation> flattenInterceptorBindings = new InterceptorBin... | [
"public",
"static",
"Set",
"<",
"Annotation",
">",
"flattenInterceptorBindings",
"(",
"EnhancedAnnotatedType",
"<",
"?",
">",
"clazz",
",",
"BeanManagerImpl",
"beanManager",
",",
"Collection",
"<",
"Annotation",
">",
"annotations",
",",
"boolean",
"addTopLevelIntercep... | Extracts a flat set of interception bindings from a given set of interceptor bindings.
@param addTopLevelInterceptorBindings add top level interceptor bindings to the result set.
@param addInheritedInterceptorBindings add inherited level interceptor bindings to the result set.
@return | [
"Extracts",
"a",
"flat",
"set",
"of",
"interception",
"bindings",
"from",
"a",
"given",
"set",
"of",
"interceptor",
"bindings",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Interceptors.java#L71-L85 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validateRIBean | protected void validateRIBean(CommonBean<?> bean, BeanManagerImpl beanManager, Collection<CommonBean<?>> specializedBeans) {
validateGeneralBean(bean, beanManager);
if (bean instanceof NewBean) {
return;
}
if (bean instanceof DecorableBean) {
validateDecorators(be... | java | protected void validateRIBean(CommonBean<?> bean, BeanManagerImpl beanManager, Collection<CommonBean<?>> specializedBeans) {
validateGeneralBean(bean, beanManager);
if (bean instanceof NewBean) {
return;
}
if (bean instanceof DecorableBean) {
validateDecorators(be... | [
"protected",
"void",
"validateRIBean",
"(",
"CommonBean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
",",
"Collection",
"<",
"CommonBean",
"<",
"?",
">",
">",
"specializedBeans",
")",
"{",
"validateGeneralBean",
"(",
"bean",
",",
"beanManager"... | Validate an RIBean. This includes validating whether two beans specialize
the same bean
@param bean the bean to validate
@param beanManager the current manager
@param specializedBeans the existing specialized beans | [
"Validate",
"an",
"RIBean",
".",
"This",
"includes",
"validating",
"whether",
"two",
"beans",
"specialize",
"the",
"same",
"bean"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L163-L195 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validateInjectionPoint | public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager) {
validateInjectionPointForDefinitionErrors(ij, ij.getBean(), beanManager);
validateMetadataInjectionPoint(ij, ij.getBean(), ValidatorLogger.INJECTION_INTO_NON_BEAN);
validateEventMetadataInjectionPoint(ij);
... | java | public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager) {
validateInjectionPointForDefinitionErrors(ij, ij.getBean(), beanManager);
validateMetadataInjectionPoint(ij, ij.getBean(), ValidatorLogger.INJECTION_INTO_NON_BEAN);
validateEventMetadataInjectionPoint(ij);
... | [
"public",
"void",
"validateInjectionPoint",
"(",
"InjectionPoint",
"ij",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"validateInjectionPointForDefinitionErrors",
"(",
"ij",
",",
"ij",
".",
"getBean",
"(",
")",
",",
"beanManager",
")",
";",
"validateMetadataInject... | Validate an injection point
@param ij the injection point to validate
@param beanManager the bean manager | [
"Validate",
"an",
"injection",
"point"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L286-L291 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validatePseudoScopedBean | private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
if (bean.getInjectionPoints().isEmpty()) {
// Skip validation if there are no injection points (e.g. for classes which are not intended to be used as beans)
return;
}
reallyValidateP... | java | private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
if (bean.getInjectionPoints().isEmpty()) {
// Skip validation if there are no injection points (e.g. for classes which are not intended to be used as beans)
return;
}
reallyValidateP... | [
"private",
"static",
"void",
"validatePseudoScopedBean",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"if",
"(",
"bean",
".",
"getInjectionPoints",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Skip validation if the... | Checks to make sure that pseudo scoped beans (i.e. @Dependent scoped beans) have no circular dependencies. | [
"Checks",
"to",
"make",
"sure",
"that",
"pseudo",
"scoped",
"beans",
"(",
"i",
".",
"e",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L923-L929 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.reallyValidatePseudoScopedBean | private static void reallyValidatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager, Set<Object> dependencyPath, Set<Bean<?>> validatedBeans) {
// see if we have already seen this bean in the dependency path
if (dependencyPath.contains(bean)) {
// create a list that shows the path t... | java | private static void reallyValidatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager, Set<Object> dependencyPath, Set<Bean<?>> validatedBeans) {
// see if we have already seen this bean in the dependency path
if (dependencyPath.contains(bean)) {
// create a list that shows the path t... | [
"private",
"static",
"void",
"reallyValidatePseudoScopedBean",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
",",
"Set",
"<",
"Object",
">",
"dependencyPath",
",",
"Set",
"<",
"Bean",
"<",
"?",
">",
">",
"validatedBeans",
")",
"{... | checks if a bean has been seen before in the dependencyPath. If not, it
resolves the InjectionPoints and adds the resolved beans to the set of
beans to be validated | [
"checks",
"if",
"a",
"bean",
"has",
"been",
"seen",
"before",
"in",
"the",
"dependencyPath",
".",
"If",
"not",
"it",
"resolves",
"the",
"InjectionPoints",
"and",
"adds",
"the",
"resolved",
"beans",
"to",
"the",
"set",
"of",
"beans",
"to",
"be",
"validated"... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L936-L971 | train |
weld/core | impl/src/main/java/org/jboss/weld/interceptor/proxy/InterceptionContext.java | InterceptionContext.forConstructorInterception | public static InterceptionContext forConstructorInterception(InterceptionModel interceptionModel, CreationalContext<?> ctx, BeanManagerImpl manager, SlimAnnotatedType<?> type) {
return of(interceptionModel, ctx, manager, null, type);
} | java | public static InterceptionContext forConstructorInterception(InterceptionModel interceptionModel, CreationalContext<?> ctx, BeanManagerImpl manager, SlimAnnotatedType<?> type) {
return of(interceptionModel, ctx, manager, null, type);
} | [
"public",
"static",
"InterceptionContext",
"forConstructorInterception",
"(",
"InterceptionModel",
"interceptionModel",
",",
"CreationalContext",
"<",
"?",
">",
"ctx",
",",
"BeanManagerImpl",
"manager",
",",
"SlimAnnotatedType",
"<",
"?",
">",
"type",
")",
"{",
"retur... | The context returned by this method may be later reused for other interception types.
@param interceptionModel
@param ctx
@param manager
@param type
@return the interception context to be used for the AroundConstruct chain | [
"The",
"context",
"returned",
"by",
"this",
"method",
"may",
"be",
"later",
"reused",
"for",
"other",
"interception",
"types",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/interceptor/proxy/InterceptionContext.java#L68-L70 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java | DisposalMethod.getRequiredQualifiers | private Set<QualifierInstance> getRequiredQualifiers(EnhancedAnnotatedParameter<?, ? super X> enhancedDisposedParameter) {
Set<Annotation> disposedParameterQualifiers = enhancedDisposedParameter.getMetaAnnotations(Qualifier.class);
if (disposedParameterQualifiers.isEmpty()) {
disposedParamet... | java | private Set<QualifierInstance> getRequiredQualifiers(EnhancedAnnotatedParameter<?, ? super X> enhancedDisposedParameter) {
Set<Annotation> disposedParameterQualifiers = enhancedDisposedParameter.getMetaAnnotations(Qualifier.class);
if (disposedParameterQualifiers.isEmpty()) {
disposedParamet... | [
"private",
"Set",
"<",
"QualifierInstance",
">",
"getRequiredQualifiers",
"(",
"EnhancedAnnotatedParameter",
"<",
"?",
",",
"?",
"super",
"X",
">",
"enhancedDisposedParameter",
")",
"{",
"Set",
"<",
"Annotation",
">",
"disposedParameterQualifiers",
"=",
"enhancedDispo... | A disposer method is bound to a producer if the producer is assignable to the disposed parameter.
@param enhancedDisposedParameter
@return the set of required qualifiers for the given disposed parameter | [
"A",
"disposer",
"method",
"is",
"bound",
"to",
"a",
"producer",
"if",
"the",
"producer",
"is",
"assignable",
"to",
"the",
"disposed",
"parameter",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java#L169-L175 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.getActualTypeArguments | public static Type[] getActualTypeArguments(Class<?> clazz) {
Type type = Types.getCanonicalType(clazz);
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | java | public static Type[] getActualTypeArguments(Class<?> clazz) {
Type type = Types.getCanonicalType(clazz);
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | [
"public",
"static",
"Type",
"[",
"]",
"getActualTypeArguments",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Type",
"type",
"=",
"Types",
".",
"getCanonicalType",
"(",
"clazz",
")",
";",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
... | Gets the actual type arguments of a class
@param clazz The class to examine
@return The type arguments | [
"Gets",
"the",
"actual",
"type",
"arguments",
"of",
"a",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L229-L236 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.getActualTypeArguments | public static Type[] getActualTypeArguments(Type type) {
Type resolvedType = Types.getCanonicalType(type);
if (resolvedType instanceof ParameterizedType) {
return ((ParameterizedType) resolvedType).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | java | public static Type[] getActualTypeArguments(Type type) {
Type resolvedType = Types.getCanonicalType(type);
if (resolvedType instanceof ParameterizedType) {
return ((ParameterizedType) resolvedType).getActualTypeArguments();
} else {
return EMPTY_TYPES;
}
} | [
"public",
"static",
"Type",
"[",
"]",
"getActualTypeArguments",
"(",
"Type",
"type",
")",
"{",
"Type",
"resolvedType",
"=",
"Types",
".",
"getCanonicalType",
"(",
"type",
")",
";",
"if",
"(",
"resolvedType",
"instanceof",
"ParameterizedType",
")",
"{",
"return... | Gets the actual type arguments of a Type
@param type The type to examine
@return The type arguments | [
"Gets",
"the",
"actual",
"type",
"arguments",
"of",
"a",
"Type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L244-L251 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.loadClass | public static <T> Class<T> loadClass(String className, ResourceLoader resourceLoader) {
try {
return cast(resourceLoader.classForName(className));
} catch (ResourceLoadingException e) {
return null;
} catch (SecurityException e) {
return null;
}
} | java | public static <T> Class<T> loadClass(String className, ResourceLoader resourceLoader) {
try {
return cast(resourceLoader.classForName(className));
} catch (ResourceLoadingException e) {
return null;
} catch (SecurityException e) {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"loadClass",
"(",
"String",
"className",
",",
"ResourceLoader",
"resourceLoader",
")",
"{",
"try",
"{",
"return",
"cast",
"(",
"resourceLoader",
".",
"classForName",
"(",
"className",
")",
")",
";"... | Tries to load a class using the specified ResourceLoader. Returns null if the class is not found.
@param className
@param resourceLoader
@return the loaded class or null if the given class cannot be loaded | [
"Tries",
"to",
"load",
"a",
"class",
"using",
"the",
"specified",
"ResourceLoader",
".",
"Returns",
"null",
"if",
"the",
"class",
"is",
"not",
"found",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L343-L351 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java | Reflections.findDeclaredMethodByName | public static Method findDeclaredMethodByName(Class<?> clazz, String methodName) {
for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) {
if (methodName.equals(method.getName())) {
return method;
}
}
return null;
} | java | public static Method findDeclaredMethodByName(Class<?> clazz, String methodName) {
for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) {
if (methodName.equals(method.getName())) {
return method;
}
}
return null;
} | [
"public",
"static",
"Method",
"findDeclaredMethodByName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"GetDeclaredMethodsAction",
"(",
"cla... | Searches for a declared method with a given name. If the class declares multiple methods with the given name,
there is no guarantee as of which methods is returned. Null is returned if the class does not declare a method
with the given name.
@param clazz the given class
@param methodName the given method name
@return m... | [
"Searches",
"for",
"a",
"declared",
"method",
"with",
"a",
"given",
"name",
".",
"If",
"the",
"class",
"declares",
"multiple",
"methods",
"with",
"the",
"given",
"name",
"there",
"is",
"no",
"guarantee",
"as",
"of",
"which",
"methods",
"is",
"returned",
".... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java#L440-L447 | train |
weld/core | environments/se/core/src/main/java/org/jboss/weld/environment/se/StartMain.java | StartMain.main | public static void main(String[] args) {
try {
new StartMain(args).go();
} catch(Throwable t) {
WeldSELogger.LOG.error("Application exited with an exception", t);
System.exit(1);
}
} | java | public static void main(String[] args) {
try {
new StartMain(args).go();
} catch(Throwable t) {
WeldSELogger.LOG.error("Application exited with an exception", t);
System.exit(1);
}
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"new",
"StartMain",
"(",
"args",
")",
".",
"go",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"WeldSELogger",
".",
"LOG",
".",
"error",
"(... | The main method called from the command line.
@param args the command line arguments | [
"The",
"main",
"method",
"called",
"from",
"the",
"command",
"line",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/StartMain.java#L55-L62 | train |
weld/core | impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java | CreationalContextImpl.release | public void release(Contextual<T> contextual, T instance) {
synchronized (dependentInstances) {
for (ContextualInstance<?> dependentInstance : dependentInstances) {
// do not destroy contextual again, since it's just being destroyed
if (contextual == null || !(depende... | java | public void release(Contextual<T> contextual, T instance) {
synchronized (dependentInstances) {
for (ContextualInstance<?> dependentInstance : dependentInstances) {
// do not destroy contextual again, since it's just being destroyed
if (contextual == null || !(depende... | [
"public",
"void",
"release",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"T",
"instance",
")",
"{",
"synchronized",
"(",
"dependentInstances",
")",
"{",
"for",
"(",
"ContextualInstance",
"<",
"?",
">",
"dependentInstance",
":",
"dependentInstances",
"... | should not be public | [
"should",
"not",
"be",
"public"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java#L126-L140 | train |
weld/core | impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java | CreationalContextImpl.destroyDependentInstance | public boolean destroyDependentInstance(T instance) {
synchronized (dependentInstances) {
for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) {
ContextualInstance<?> contextualInstance = iterator.next();
if (contextualIn... | java | public boolean destroyDependentInstance(T instance) {
synchronized (dependentInstances) {
for (Iterator<ContextualInstance<?>> iterator = dependentInstances.iterator(); iterator.hasNext();) {
ContextualInstance<?> contextualInstance = iterator.next();
if (contextualIn... | [
"public",
"boolean",
"destroyDependentInstance",
"(",
"T",
"instance",
")",
"{",
"synchronized",
"(",
"dependentInstances",
")",
"{",
"for",
"(",
"Iterator",
"<",
"ContextualInstance",
"<",
"?",
">",
">",
"iterator",
"=",
"dependentInstances",
".",
"iterator",
"... | Destroys dependent instance
@param instance
@return true if the instance was destroyed, false otherwise | [
"Destroys",
"dependent",
"instance"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/CreationalContextImpl.java#L212-L224 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java | AbstractProducerBean.checkReturnValue | protected T checkReturnValue(T instance) {
if (instance == null && !isDependent()) {
throw BeanLogger.LOG.nullNotAllowedFromProducer(getProducer(), Formats.formatAsStackTraceElement(getAnnotated().getJavaMember()));
}
if (instance == null) {
InjectionPoint injectionPoint ... | java | protected T checkReturnValue(T instance) {
if (instance == null && !isDependent()) {
throw BeanLogger.LOG.nullNotAllowedFromProducer(getProducer(), Formats.formatAsStackTraceElement(getAnnotated().getJavaMember()));
}
if (instance == null) {
InjectionPoint injectionPoint ... | [
"protected",
"T",
"checkReturnValue",
"(",
"T",
"instance",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
"&&",
"!",
"isDependent",
"(",
")",
")",
"{",
"throw",
"BeanLogger",
".",
"LOG",
".",
"nullNotAllowedFromProducer",
"(",
"getProducer",
"(",
")",
","... | Validates the return value
@param instance The instance to validate | [
"Validates",
"the",
"return",
"value"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java#L134-L161 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java | ImmutableMap.copyOf | public static <K, V> Map<K, V> copyOf(Map<K, V> map) {
Preconditions.checkNotNull(map);
return ImmutableMap.<K, V> builder().putAll(map).build();
} | java | public static <K, V> Map<K, V> copyOf(Map<K, V> map) {
Preconditions.checkNotNull(map);
return ImmutableMap.<K, V> builder().putAll(map).build();
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"copyOf",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"map",
")",
";",
"return",
"ImmutableMap",
".",
"<",
"K",
",... | Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards.
@param map the given map
@return an immutable map | [
"Creates",
"an",
"immutable",
"map",
".",
"A",
"copy",
"of",
"the",
"given",
"map",
"is",
"used",
".",
"As",
"a",
"result",
"it",
"is",
"safe",
"to",
"modify",
"the",
"source",
"map",
"afterwards",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java#L48-L51 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java | ImmutableMap.of | public static <K, V> Map<K, V> of(K key, V value) {
return new ImmutableMapEntry<K, V>(key, value);
} | java | public static <K, V> Map<K, V> of(K key, V value) {
return new ImmutableMapEntry<K, V>(key, value);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"of",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"new",
"ImmutableMapEntry",
"<",
"K",
",",
"V",
">",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Creates an immutable singleton instance.
@param key
@param value
@return | [
"Creates",
"an",
"immutable",
"singleton",
"instance",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/ImmutableMap.java#L60-L62 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Formats.java | Formats.formatAsStackTraceElement | public static String formatAsStackTraceElement(InjectionPoint ij) {
Member member;
if (ij.getAnnotated() instanceof AnnotatedField) {
AnnotatedField<?> annotatedField = (AnnotatedField<?>) ij.getAnnotated();
member = annotatedField.getJavaMember();
} else if (ij.getAnnota... | java | public static String formatAsStackTraceElement(InjectionPoint ij) {
Member member;
if (ij.getAnnotated() instanceof AnnotatedField) {
AnnotatedField<?> annotatedField = (AnnotatedField<?>) ij.getAnnotated();
member = annotatedField.getJavaMember();
} else if (ij.getAnnota... | [
"public",
"static",
"String",
"formatAsStackTraceElement",
"(",
"InjectionPoint",
"ij",
")",
"{",
"Member",
"member",
";",
"if",
"(",
"ij",
".",
"getAnnotated",
"(",
")",
"instanceof",
"AnnotatedField",
")",
"{",
"AnnotatedField",
"<",
"?",
">",
"annotatedField"... | See also WELD-1454.
@param ij
@return the formatted string | [
"See",
"also",
"WELD",
"-",
"1454",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Formats.java#L93-L107 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Formats.java | Formats.getLineNumber | public static int getLineNumber(Member member) {
if (!(member instanceof Method || member instanceof Constructor)) {
// We are not able to get this info for fields
return 0;
}
// BCEL is an optional dependency, if we cannot load it, simply return 0
if (!Reflecti... | java | public static int getLineNumber(Member member) {
if (!(member instanceof Method || member instanceof Constructor)) {
// We are not able to get this info for fields
return 0;
}
// BCEL is an optional dependency, if we cannot load it, simply return 0
if (!Reflecti... | [
"public",
"static",
"int",
"getLineNumber",
"(",
"Member",
"member",
")",
"{",
"if",
"(",
"!",
"(",
"member",
"instanceof",
"Method",
"||",
"member",
"instanceof",
"Constructor",
")",
")",
"{",
"// We are not able to get this info for fields",
"return",
"0",
";",
... | Try to get the line number associated with the given member.
The reflection API does not expose such an info and so we need to analyse the bytecode. Unfortunately, it seems there is no way to get this kind of
information for fields. Moreover, the <code>LineNumberTable</code> attribute is just optional, i.e. the compil... | [
"Try",
"to",
"get",
"the",
"line",
"number",
"associated",
"with",
"the",
"given",
"member",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Formats.java#L129-L204 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/Formats.java | Formats.parseModifiers | private static List<String> parseModifiers(int modifiers) {
List<String> result = new ArrayList<String>();
if (Modifier.isPrivate(modifiers)) {
result.add("private");
}
if (Modifier.isProtected(modifiers)) {
result.add("protected");
}
if (Modifier.... | java | private static List<String> parseModifiers(int modifiers) {
List<String> result = new ArrayList<String>();
if (Modifier.isPrivate(modifiers)) {
result.add("private");
}
if (Modifier.isProtected(modifiers)) {
result.add("protected");
}
if (Modifier.... | [
"private",
"static",
"List",
"<",
"String",
">",
"parseModifiers",
"(",
"int",
"modifiers",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"Modifier",
".",
"isPrivate",
"(",
"modif... | Parses a reflection modifier to a list of string
@param modifiers The modifier to parse
@return The resulting string list | [
"Parses",
"a",
"reflection",
"modifier",
"to",
"a",
"list",
"of",
"string"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/Formats.java#L406-L445 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/FastAnnotatedTypeLoader.java | FastAnnotatedTypeLoader.initCheckTypeModifiers | private boolean initCheckTypeModifiers() {
Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader()));
if (classInfoclass != null) {
try {
Method setFlags = AccessController.doPrivileged... | java | private boolean initCheckTypeModifiers() {
Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader()));
if (classInfoclass != null) {
try {
Method setFlags = AccessController.doPrivileged... | [
"private",
"boolean",
"initCheckTypeModifiers",
"(",
")",
"{",
"Class",
"<",
"?",
">",
"classInfoclass",
"=",
"Reflections",
".",
"loadClass",
"(",
"CLASSINFO_CLASS_NAME",
",",
"new",
"ClassLoaderResourceLoader",
"(",
"classFileServices",
".",
"getClass",
"(",
")",
... | checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37 | [
"checking",
"availability",
"of",
"ClassInfo",
".",
"setFlags",
"method",
"is",
"just",
"workaround",
"for",
"JANDEX",
"-",
"37"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/FastAnnotatedTypeLoader.java#L132-L146 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java | ProducerMethod.of | public static <X, T> ProducerMethod<X, T> of(BeanAttributes<T> attributes, EnhancedAnnotatedMethod<T, ? super X> method, AbstractClassBean<X> declaringBean, DisposalMethod<X, ?> disposalMethod, BeanManagerImpl beanManager, ServiceRegistry services) {
return new ProducerMethod<X, T>(createId(attributes, method, ... | java | public static <X, T> ProducerMethod<X, T> of(BeanAttributes<T> attributes, EnhancedAnnotatedMethod<T, ? super X> method, AbstractClassBean<X> declaringBean, DisposalMethod<X, ?> disposalMethod, BeanManagerImpl beanManager, ServiceRegistry services) {
return new ProducerMethod<X, T>(createId(attributes, method, ... | [
"public",
"static",
"<",
"X",
",",
"T",
">",
"ProducerMethod",
"<",
"X",
",",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"EnhancedAnnotatedMethod",
"<",
"T",
",",
"?",
"super",
"X",
">",
"method",
",",
"AbstractClassBean",
... | Creates a producer method Web Bean
@param method The underlying method abstraction
@param declaringBean The declaring bean abstraction
@param beanManager the current manager
@return A producer Web Bean | [
"Creates",
"a",
"producer",
"method",
"Web",
"Bean"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java#L59-L61 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java | BytecodeUtils.addLoadInstruction | public static void addLoadInstruction(CodeAttribute code, String type, int variable) {
char tp = type.charAt(0);
if (tp != 'L' && tp != '[') {
// we have a primitive type
switch (tp) {
case 'J':
code.lload(variable);
break;
... | java | public static void addLoadInstruction(CodeAttribute code, String type, int variable) {
char tp = type.charAt(0);
if (tp != 'L' && tp != '[') {
// we have a primitive type
switch (tp) {
case 'J':
code.lload(variable);
break;
... | [
"public",
"static",
"void",
"addLoadInstruction",
"(",
"CodeAttribute",
"code",
",",
"String",
"type",
",",
"int",
"variable",
")",
"{",
"char",
"tp",
"=",
"type",
".",
"charAt",
"(",
"0",
")",
";",
"if",
"(",
"tp",
"!=",
"'",
"'",
"&&",
"tp",
"!=",
... | Adds the correct load instruction based on the type descriptor
@param code the bytecode to add the instruction to
@param type the type of the variable
@param variable the variable number | [
"Adds",
"the",
"correct",
"load",
"instruction",
"based",
"on",
"the",
"type",
"descriptor"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java#L54-L74 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java | BytecodeUtils.pushClassType | public static void pushClassType(CodeAttribute b, String classType) {
if (classType.length() != 1) {
if (classType.startsWith("L") && classType.endsWith(";")) {
classType = classType.substring(1, classType.length() - 1);
}
b.loadClass(classType);
} els... | java | public static void pushClassType(CodeAttribute b, String classType) {
if (classType.length() != 1) {
if (classType.startsWith("L") && classType.endsWith(";")) {
classType = classType.substring(1, classType.length() - 1);
}
b.loadClass(classType);
} els... | [
"public",
"static",
"void",
"pushClassType",
"(",
"CodeAttribute",
"b",
",",
"String",
"classType",
")",
"{",
"if",
"(",
"classType",
".",
"length",
"(",
")",
"!=",
"1",
")",
"{",
"if",
"(",
"classType",
".",
"startsWith",
"(",
"\"L\"",
")",
"&&",
"cla... | Pushes a class type onto the stack from the string representation This can
also handle primitives
@param b the bytecode
@param classType the type descriptor for the class or primitive to push.
This will accept both the java.lang.Object form and the
Ljava/lang/Object; form | [
"Pushes",
"a",
"class",
"type",
"onto",
"the",
"stack",
"from",
"the",
"string",
"representation",
"This",
"can",
"also",
"handle",
"primitives"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java#L85-L122 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java | StereotypeModel.checkBindings | private void checkBindings(EnhancedAnnotation<T> annotatedAnnotation) {
Set<Annotation> bindings = annotatedAnnotation.getMetaAnnotations(Qualifier.class);
if (bindings.size() > 0) {
for (Annotation annotation : bindings) {
if (!annotation.annotationType().equals(Named.class)... | java | private void checkBindings(EnhancedAnnotation<T> annotatedAnnotation) {
Set<Annotation> bindings = annotatedAnnotation.getMetaAnnotations(Qualifier.class);
if (bindings.size() > 0) {
for (Annotation annotation : bindings) {
if (!annotation.annotationType().equals(Named.class)... | [
"private",
"void",
"checkBindings",
"(",
"EnhancedAnnotation",
"<",
"T",
">",
"annotatedAnnotation",
")",
"{",
"Set",
"<",
"Annotation",
">",
"bindings",
"=",
"annotatedAnnotation",
".",
"getMetaAnnotations",
"(",
"Qualifier",
".",
"class",
")",
";",
"if",
"(",
... | Validates the binding types | [
"Validates",
"the",
"binding",
"types"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java#L89-L98 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java | StereotypeModel.initBeanNameDefaulted | private void initBeanNameDefaulted(EnhancedAnnotation<T> annotatedAnnotation) {
if (annotatedAnnotation.isAnnotationPresent(Named.class)) {
if (!"".equals(annotatedAnnotation.getAnnotation(Named.class).value())) {
throw MetadataLogger.LOG.valueOnNamedStereotype(annotatedAnnotation);
... | java | private void initBeanNameDefaulted(EnhancedAnnotation<T> annotatedAnnotation) {
if (annotatedAnnotation.isAnnotationPresent(Named.class)) {
if (!"".equals(annotatedAnnotation.getAnnotation(Named.class).value())) {
throw MetadataLogger.LOG.valueOnNamedStereotype(annotatedAnnotation);
... | [
"private",
"void",
"initBeanNameDefaulted",
"(",
"EnhancedAnnotation",
"<",
"T",
">",
"annotatedAnnotation",
")",
"{",
"if",
"(",
"annotatedAnnotation",
".",
"isAnnotationPresent",
"(",
"Named",
".",
"class",
")",
")",
"{",
"if",
"(",
"!",
"\"\"",
".",
"equals... | Initializes the bean name defaulted | [
"Initializes",
"the",
"bean",
"name",
"defaulted"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java#L114-L121 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java | StereotypeModel.initDefaultScopeType | private void initDefaultScopeType(EnhancedAnnotation<T> annotatedAnnotation) {
Set<Annotation> scopeTypes = new HashSet<Annotation>();
scopeTypes.addAll(annotatedAnnotation.getMetaAnnotations(Scope.class));
scopeTypes.addAll(annotatedAnnotation.getMetaAnnotations(NormalScope.class));
if ... | java | private void initDefaultScopeType(EnhancedAnnotation<T> annotatedAnnotation) {
Set<Annotation> scopeTypes = new HashSet<Annotation>();
scopeTypes.addAll(annotatedAnnotation.getMetaAnnotations(Scope.class));
scopeTypes.addAll(annotatedAnnotation.getMetaAnnotations(NormalScope.class));
if ... | [
"private",
"void",
"initDefaultScopeType",
"(",
"EnhancedAnnotation",
"<",
"T",
">",
"annotatedAnnotation",
")",
"{",
"Set",
"<",
"Annotation",
">",
"scopeTypes",
"=",
"new",
"HashSet",
"<",
"Annotation",
">",
"(",
")",
";",
"scopeTypes",
".",
"addAll",
"(",
... | Initializes the default scope type | [
"Initializes",
"the",
"default",
"scope",
"type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java#L126-L135 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Types.java | Types.boxedType | public static Type boxedType(Type type) {
if (type instanceof Class<?>) {
return boxedClass((Class<?>) type);
} else {
return type;
}
} | java | public static Type boxedType(Type type) {
if (type instanceof Class<?>) {
return boxedClass((Class<?>) type);
} else {
return type;
}
} | [
"public",
"static",
"Type",
"boxedType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"return",
"boxedClass",
"(",
"(",
"Class",
"<",
"?",
">",
")",
"type",
")",
";",
"}",
"else",
"{",
"return",
... | Gets the boxed type of a class
@param type The type
@return The boxed type | [
"Gets",
"the",
"boxed",
"type",
"of",
"a",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Types.java#L54-L60 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Types.java | Types.getCanonicalType | public static Type getCanonicalType(Class<?> clazz) {
if (clazz.isArray()) {
Class<?> componentType = clazz.getComponentType();
Type resolvedComponentType = getCanonicalType(componentType);
if (componentType != resolvedComponentType) {
// identity check intent... | java | public static Type getCanonicalType(Class<?> clazz) {
if (clazz.isArray()) {
Class<?> componentType = clazz.getComponentType();
Type resolvedComponentType = getCanonicalType(componentType);
if (componentType != resolvedComponentType) {
// identity check intent... | [
"public",
"static",
"Type",
"getCanonicalType",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"isArray",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"componentType",
"=",
"clazz",
".",
"getComponentType",
"(",
")",
";",
"Ty... | Returns a canonical type for a given class.
If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type
variables) is resolved.
If the class is an array then the component type of the array is canonicalized
Otherwise, the class is returned.
@return | [
"Returns",
"a",
"canonical",
"type",
"for",
"a",
"given",
"class",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Types.java#L127-L142 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Types.java | Types.isArray | public static boolean isArray(Type type) {
return (type instanceof GenericArrayType) || (type instanceof Class<?> && ((Class<?>) type).isArray());
} | java | public static boolean isArray(Type type) {
return (type instanceof GenericArrayType) || (type instanceof Class<?> && ((Class<?>) type).isArray());
} | [
"public",
"static",
"boolean",
"isArray",
"(",
"Type",
"type",
")",
"{",
"return",
"(",
"type",
"instanceof",
"GenericArrayType",
")",
"||",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
"&&",
"(",
"(",
"Class",
"<",
"?",
">",
")",
"type",
")",
... | Determines whether the given type is an array type.
@param type the given type
@return true if the given type is a subclass of java.lang.Class or implements GenericArrayType | [
"Determines",
"whether",
"the",
"given",
"type",
"is",
"an",
"array",
"type",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Types.java#L221-L223 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Types.java | Types.getArrayComponentType | public static Type getArrayComponentType(Type type) {
if (type instanceof GenericArrayType) {
return GenericArrayType.class.cast(type).getGenericComponentType();
}
if (type instanceof Class<?>) {
Class<?> clazz = (Class<?>) type;
if (clazz.isArray()) {
... | java | public static Type getArrayComponentType(Type type) {
if (type instanceof GenericArrayType) {
return GenericArrayType.class.cast(type).getGenericComponentType();
}
if (type instanceof Class<?>) {
Class<?> clazz = (Class<?>) type;
if (clazz.isArray()) {
... | [
"public",
"static",
"Type",
"getArrayComponentType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"GenericArrayType",
")",
"{",
"return",
"GenericArrayType",
".",
"class",
".",
"cast",
"(",
"type",
")",
".",
"getGenericComponentType",
"(",
"... | Determines the component type for a given array type.
@param type the given array type
@return the component type of a given array type | [
"Determines",
"the",
"component",
"type",
"for",
"a",
"given",
"array",
"type",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Types.java#L231-L242 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Types.java | Types.isArrayOfUnboundedTypeVariablesOrObjects | public static boolean isArrayOfUnboundedTypeVariablesOrObjects(Type[] types) {
for (Type type : types) {
if (Object.class.equals(type)) {
continue;
}
if (type instanceof TypeVariable<?>) {
Type[] bounds = ((TypeVariable<?>) type).getBounds();
... | java | public static boolean isArrayOfUnboundedTypeVariablesOrObjects(Type[] types) {
for (Type type : types) {
if (Object.class.equals(type)) {
continue;
}
if (type instanceof TypeVariable<?>) {
Type[] bounds = ((TypeVariable<?>) type).getBounds();
... | [
"public",
"static",
"boolean",
"isArrayOfUnboundedTypeVariablesOrObjects",
"(",
"Type",
"[",
"]",
"types",
")",
"{",
"for",
"(",
"Type",
"type",
":",
"types",
")",
"{",
"if",
"(",
"Object",
".",
"class",
".",
"equals",
"(",
"type",
")",
")",
"{",
"contin... | Determines whether the given array only contains unbounded type variables or Object.class.
@param types the given array of types
@return true if and only if the given array only contains unbounded type variables or Object.class | [
"Determines",
"whether",
"the",
"given",
"array",
"only",
"contains",
"unbounded",
"type",
"variables",
"or",
"Object",
".",
"class",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Types.java#L250-L264 | train |
weld/core | impl/src/main/java/org/jboss/weld/contexts/unbound/DependentContextImpl.java | DependentContextImpl.get | public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
if (creationalContext != null) {
T instance = contextual.create(creationalContext);
if (creationalContext instanceo... | java | public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
if (creationalContext != null) {
T instance = contextual.create(creationalContext);
if (creationalContext instanceo... | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"CreationalContext",
"<",
"T",
">",
"creationalContext",
")",
"{",
"if",
"(",
"!",
"isActive",
"(",
")",
")",
"{",
"throw",
"new",
"ContextNotActiveException",
"(",... | Overridden method always creating a new instance
@param contextual The bean to create
@param creationalContext The creation context | [
"Overridden",
"method",
"always",
"creating",
"a",
"new",
"instance"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/unbound/DependentContextImpl.java#L65-L78 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java | BeanDeployment.createEnablement | public void createEnablement() {
GlobalEnablementBuilder builder = beanManager.getServices().get(GlobalEnablementBuilder.class);
ModuleEnablement enablement = builder.createModuleEnablement(this);
beanManager.setEnabled(enablement);
if (BootstrapLogger.LOG.isDebugEnabled()) {
... | java | public void createEnablement() {
GlobalEnablementBuilder builder = beanManager.getServices().get(GlobalEnablementBuilder.class);
ModuleEnablement enablement = builder.createModuleEnablement(this);
beanManager.setEnabled(enablement);
if (BootstrapLogger.LOG.isDebugEnabled()) {
... | [
"public",
"void",
"createEnablement",
"(",
")",
"{",
"GlobalEnablementBuilder",
"builder",
"=",
"beanManager",
".",
"getServices",
"(",
")",
".",
"get",
"(",
"GlobalEnablementBuilder",
".",
"class",
")",
";",
"ModuleEnablement",
"enablement",
"=",
"builder",
".",
... | Initializes module enablement.
@see ModuleEnablement | [
"Initializes",
"module",
"enablement",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java#L206-L216 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java | DecoratorImpl.of | public static <T> DecoratorImpl<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
return new DecoratorImpl<T>(attributes, clazz, beanManager);
} | java | public static <T> DecoratorImpl<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
return new DecoratorImpl<T>(attributes, clazz, beanManager);
} | [
"public",
"static",
"<",
"T",
">",
"DecoratorImpl",
"<",
"T",
">",
"of",
"(",
"BeanAttributes",
"<",
"T",
">",
"attributes",
",",
"EnhancedAnnotatedType",
"<",
"T",
">",
"clazz",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"return",
"new",
"DecoratorImp... | Creates a decorator bean
@param <T> The type
@param clazz The class
@param beanManager the current manager
@return a Bean | [
"Creates",
"a",
"decorator",
"bean"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java#L49-L51 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/MergedStereotypes.java | MergedStereotypes.merge | protected void merge(Set<Annotation> stereotypeAnnotations) {
final MetaAnnotationStore store = manager.getServices().get(MetaAnnotationStore.class);
for (Annotation stereotypeAnnotation : stereotypeAnnotations) {
// Retrieve and merge all metadata from stereotypes
StereotypeMode... | java | protected void merge(Set<Annotation> stereotypeAnnotations) {
final MetaAnnotationStore store = manager.getServices().get(MetaAnnotationStore.class);
for (Annotation stereotypeAnnotation : stereotypeAnnotations) {
// Retrieve and merge all metadata from stereotypes
StereotypeMode... | [
"protected",
"void",
"merge",
"(",
"Set",
"<",
"Annotation",
">",
"stereotypeAnnotations",
")",
"{",
"final",
"MetaAnnotationStore",
"store",
"=",
"manager",
".",
"getServices",
"(",
")",
".",
"get",
"(",
"MetaAnnotationStore",
".",
"class",
")",
";",
"for",
... | Perform the merge
@param stereotypeAnnotations The stereotype annotations | [
"Perform",
"the",
"merge"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/MergedStereotypes.java#L73-L94 | train |
weld/core | environments/se/core/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java | RunnableDecorator.run | @Override
public void run() {
try {
threadContext.activate();
// run the original thread
runnable.run();
} finally {
threadContext.invalidate();
threadContext.deactivate();
}
} | java | @Override
public void run() {
try {
threadContext.activate();
// run the original thread
runnable.run();
} finally {
threadContext.invalidate();
threadContext.deactivate();
}
} | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"threadContext",
".",
"activate",
"(",
")",
";",
"// run the original thread",
"runnable",
".",
"run",
"(",
")",
";",
"}",
"finally",
"{",
"threadContext",
".",
"invalidate",
"(",
")",
... | Set up the ThreadContext and delegate. | [
"Set",
"up",
"the",
"ThreadContext",
"and",
"delegate",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java#L52-L63 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java | AbstractBeanDeployer.deploySpecialized | protected AbstractBeanDeployer<E> deploySpecialized() {
// ensure that all decorators are initialized before initializing
// the rest of the beans
for (DecoratorImpl<?> bean : getEnvironment().getDecorators()) {
bean.initialize(getEnvironment());
containerLifecycleEvents.... | java | protected AbstractBeanDeployer<E> deploySpecialized() {
// ensure that all decorators are initialized before initializing
// the rest of the beans
for (DecoratorImpl<?> bean : getEnvironment().getDecorators()) {
bean.initialize(getEnvironment());
containerLifecycleEvents.... | [
"protected",
"AbstractBeanDeployer",
"<",
"E",
">",
"deploySpecialized",
"(",
")",
"{",
"// ensure that all decorators are initialized before initializing",
"// the rest of the beans",
"for",
"(",
"DecoratorImpl",
"<",
"?",
">",
"bean",
":",
"getEnvironment",
"(",
")",
".... | interceptors, decorators and observers go first | [
"interceptors",
"decorators",
"and",
"observers",
"go",
"first"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java#L100-L116 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Observers.java | Observers.validateObserverMethod | public static void validateObserverMethod(ObserverMethod<?> observerMethod, BeanManager beanManager, ObserverMethod<?> originalObserverMethod) {
Set<Annotation> qualifiers = observerMethod.getObservedQualifiers();
if (observerMethod.getBeanClass() == null) {
throw EventLogger.LOG.observerMet... | java | public static void validateObserverMethod(ObserverMethod<?> observerMethod, BeanManager beanManager, ObserverMethod<?> originalObserverMethod) {
Set<Annotation> qualifiers = observerMethod.getObservedQualifiers();
if (observerMethod.getBeanClass() == null) {
throw EventLogger.LOG.observerMet... | [
"public",
"static",
"void",
"validateObserverMethod",
"(",
"ObserverMethod",
"<",
"?",
">",
"observerMethod",
",",
"BeanManager",
"beanManager",
",",
"ObserverMethod",
"<",
"?",
">",
"originalObserverMethod",
")",
"{",
"Set",
"<",
"Annotation",
">",
"qualifiers",
... | Validates given external observer method.
@param observerMethod the given observer method
@param beanManager
@param originalObserverMethod observer method replaced by given observer method (this parameter is optional) | [
"Validates",
"given",
"external",
"observer",
"method",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Observers.java#L124-L145 | train |
weld/core | impl/src/main/java/org/jboss/weld/resolution/CovariantTypes.java | CovariantTypes.isAssignableFrom | private static boolean isAssignableFrom(WildcardType type1, Type type2) {
if (!isAssignableFrom(type1.getUpperBounds()[0], type2)) {
return false;
}
if (type1.getLowerBounds().length > 0 && !isAssignableFrom(type2, type1.getLowerBounds()[0])) {
return false;
}
... | java | private static boolean isAssignableFrom(WildcardType type1, Type type2) {
if (!isAssignableFrom(type1.getUpperBounds()[0], type2)) {
return false;
}
if (type1.getLowerBounds().length > 0 && !isAssignableFrom(type2, type1.getLowerBounds()[0])) {
return false;
}
... | [
"private",
"static",
"boolean",
"isAssignableFrom",
"(",
"WildcardType",
"type1",
",",
"Type",
"type2",
")",
"{",
"if",
"(",
"!",
"isAssignableFrom",
"(",
"type1",
".",
"getUpperBounds",
"(",
")",
"[",
"0",
"]",
",",
"type2",
")",
")",
"{",
"return",
"fa... | This logic is shared for all actual types i.e. raw types, parameterized types and generic array types. | [
"This",
"logic",
"is",
"shared",
"for",
"all",
"actual",
"types",
"i",
".",
"e",
".",
"raw",
"types",
"parameterized",
"types",
"and",
"generic",
"array",
"types",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/CovariantTypes.java#L295-L303 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/InterceptionDecorationContext.java | InterceptionDecorationContext.peekIfNotEmpty | public static CombinedInterceptorAndDecoratorStackMethodHandler peekIfNotEmpty() {
Stack stack = interceptionContexts.get();
if (stack == null) {
return null;
}
return stack.peek();
} | java | public static CombinedInterceptorAndDecoratorStackMethodHandler peekIfNotEmpty() {
Stack stack = interceptionContexts.get();
if (stack == null) {
return null;
}
return stack.peek();
} | [
"public",
"static",
"CombinedInterceptorAndDecoratorStackMethodHandler",
"peekIfNotEmpty",
"(",
")",
"{",
"Stack",
"stack",
"=",
"interceptionContexts",
".",
"get",
"(",
")",
";",
"if",
"(",
"stack",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Peeks the current top of the stack or returns null if the stack is empty
@return the current top of the stack or returns null if the stack is empty | [
"Peeks",
"the",
"current",
"top",
"of",
"the",
"stack",
"or",
"returns",
"null",
"if",
"the",
"stack",
"is",
"empty"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptionDecorationContext.java#L151-L157 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/InterceptionDecorationContext.java | InterceptionDecorationContext.getStack | public static Stack getStack() {
Stack stack = interceptionContexts.get();
if (stack == null) {
stack = new Stack(interceptionContexts);
interceptionContexts.set(stack);
}
return stack;
} | java | public static Stack getStack() {
Stack stack = interceptionContexts.get();
if (stack == null) {
stack = new Stack(interceptionContexts);
interceptionContexts.set(stack);
}
return stack;
} | [
"public",
"static",
"Stack",
"getStack",
"(",
")",
"{",
"Stack",
"stack",
"=",
"interceptionContexts",
".",
"get",
"(",
")",
";",
"if",
"(",
"stack",
"==",
"null",
")",
"{",
"stack",
"=",
"new",
"Stack",
"(",
"interceptionContexts",
")",
";",
"intercepti... | Gets the current Stack. If the stack is not set, a new empty instance is created and set.
@return | [
"Gets",
"the",
"current",
"Stack",
".",
"If",
"the",
"stack",
"is",
"not",
"set",
"a",
"new",
"empty",
"instance",
"is",
"created",
"and",
"set",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptionDecorationContext.java#L210-L217 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/Proxies.java | Proxies.isTypesProxyable | public static boolean isTypesProxyable(Iterable<? extends Type> types, ServiceRegistry services) {
return getUnproxyableTypesException(types, services) == null;
} | java | public static boolean isTypesProxyable(Iterable<? extends Type> types, ServiceRegistry services) {
return getUnproxyableTypesException(types, services) == null;
} | [
"public",
"static",
"boolean",
"isTypesProxyable",
"(",
"Iterable",
"<",
"?",
"extends",
"Type",
">",
"types",
",",
"ServiceRegistry",
"services",
")",
"{",
"return",
"getUnproxyableTypesException",
"(",
"types",
",",
"services",
")",
"==",
"null",
";",
"}"
] | Indicates if a set of types are all proxyable
@param types The types to test
@return True if proxyable, false otherwise | [
"Indicates",
"if",
"a",
"set",
"of",
"types",
"are",
"all",
"proxyable"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Proxies.java#L160-L162 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/Iterators.java | Iterators.addAll | public static <T> boolean addAll(Collection<T> target, Iterator<? extends T> iterator) {
Preconditions.checkArgumentNotNull(target, "target");
boolean modified = false;
while (iterator.hasNext()) {
modified |= target.add(iterator.next());
}
return modified;
} | java | public static <T> boolean addAll(Collection<T> target, Iterator<? extends T> iterator) {
Preconditions.checkArgumentNotNull(target, "target");
boolean modified = false;
while (iterator.hasNext()) {
modified |= target.add(iterator.next());
}
return modified;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"target",
",",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"iterator",
")",
"{",
"Preconditions",
".",
"checkArgumentNotNull",
"(",
"target",
",",
"\"target\"",
")",
... | Add all elements in the iterator to the collection.
@param target
@param iterator
@return true if the target was modified, false otherwise | [
"Add",
"all",
"elements",
"in",
"the",
"iterator",
"to",
"the",
"collection",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/Iterators.java#L46-L53 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/Iterators.java | Iterators.concat | public static <T> Iterator<T> concat(Iterator<? extends Iterator<? extends T>> iterators) {
Preconditions.checkArgumentNotNull(iterators, "iterators");
return new CombinedIterator<T>(iterators);
} | java | public static <T> Iterator<T> concat(Iterator<? extends Iterator<? extends T>> iterators) {
Preconditions.checkArgumentNotNull(iterators, "iterators");
return new CombinedIterator<T>(iterators);
} | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"concat",
"(",
"Iterator",
"<",
"?",
"extends",
"Iterator",
"<",
"?",
"extends",
"T",
">",
">",
"iterators",
")",
"{",
"Preconditions",
".",
"checkArgumentNotNull",
"(",
"iterators",
",",
"\"i... | Combine the iterators into a single one.
@param iterators An iterator of iterators
@return a single combined iterator | [
"Combine",
"the",
"iterators",
"into",
"a",
"single",
"one",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/Iterators.java#L61-L64 | train |
weld/core | probe/core/src/main/java/org/jboss/weld/probe/HtmlTag.java | HtmlTag.attr | HtmlTag attr(String name, String value) {
if (attrs == null) {
attrs = new HashMap<>();
}
attrs.put(name, value);
return this;
} | java | HtmlTag attr(String name, String value) {
if (attrs == null) {
attrs = new HashMap<>();
}
attrs.put(name, value);
return this;
} | [
"HtmlTag",
"attr",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"attrs",
"==",
"null",
")",
"{",
"attrs",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"attrs",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
... | Attribute name and value are not escaped or modified in any way.
@param name
@param value
@return self | [
"Attribute",
"name",
"and",
"value",
"are",
"not",
"escaped",
"or",
"modified",
"in",
"any",
"way",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/probe/core/src/main/java/org/jboss/weld/probe/HtmlTag.java#L173-L179 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/MetaAnnotationStore.java | MetaAnnotationStore.clearAnnotationData | public void clearAnnotationData(Class<? extends Annotation> annotationClass) {
stereotypes.invalidate(annotationClass);
scopes.invalidate(annotationClass);
qualifiers.invalidate(annotationClass);
interceptorBindings.invalidate(annotationClass);
} | java | public void clearAnnotationData(Class<? extends Annotation> annotationClass) {
stereotypes.invalidate(annotationClass);
scopes.invalidate(annotationClass);
qualifiers.invalidate(annotationClass);
interceptorBindings.invalidate(annotationClass);
} | [
"public",
"void",
"clearAnnotationData",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"stereotypes",
".",
"invalidate",
"(",
"annotationClass",
")",
";",
"scopes",
".",
"invalidate",
"(",
"annotationClass",
")",
";",
"qualif... | removes all data for an annotation class. This should be called after an
annotation has been modified through the SPI | [
"removes",
"all",
"data",
"for",
"an",
"annotation",
"class",
".",
"This",
"should",
"be",
"called",
"after",
"an",
"annotation",
"has",
"been",
"modified",
"through",
"the",
"SPI"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/MetaAnnotationStore.java#L153-L158 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/WeldCollections.java | WeldCollections.immutableMapView | public static <K, V> Map<K, V> immutableMapView(Map<K, V> map) {
if (map instanceof ImmutableMap<?, ?>) {
return map;
}
return Collections.unmodifiableMap(map);
} | java | public static <K, V> Map<K, V> immutableMapView(Map<K, V> map) {
if (map instanceof ImmutableMap<?, ?>) {
return map;
}
return Collections.unmodifiableMap(map);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"immutableMapView",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"if",
"(",
"map",
"instanceof",
"ImmutableMap",
"<",
"?",
",",
"?",
">",
")",
"{",
"return",
... | Returns an immutable view of a given map. | [
"Returns",
"an",
"immutable",
"view",
"of",
"a",
"given",
"map",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/WeldCollections.java#L67-L72 | train |
weld/core | impl/src/main/java/org/jboss/weld/injection/producer/ProducerMethodProducer.java | ProducerMethodProducer.checkProducerMethod | protected void checkProducerMethod(EnhancedAnnotatedMethod<T, ? super X> method) {
if (method.getEnhancedParameters(Observes.class).size() > 0) {
throw BeanLogger.LOG.inconsistentAnnotationsOnMethod(PRODUCER_ANNOTATION, "@Observes", this.method,
Formats.formatAsStackTraceElement(... | java | protected void checkProducerMethod(EnhancedAnnotatedMethod<T, ? super X> method) {
if (method.getEnhancedParameters(Observes.class).size() > 0) {
throw BeanLogger.LOG.inconsistentAnnotationsOnMethod(PRODUCER_ANNOTATION, "@Observes", this.method,
Formats.formatAsStackTraceElement(... | [
"protected",
"void",
"checkProducerMethod",
"(",
"EnhancedAnnotatedMethod",
"<",
"T",
",",
"?",
"super",
"X",
">",
"method",
")",
"{",
"if",
"(",
"method",
".",
"getEnhancedParameters",
"(",
"Observes",
".",
"class",
")",
".",
"size",
"(",
")",
">",
"0",
... | Validates the producer method | [
"Validates",
"the",
"producer",
"method"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/injection/producer/ProducerMethodProducer.java#L69-L94 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProtectionDomainCache.java | ProtectionDomainCache.getProtectionDomainForProxy | ProtectionDomain getProtectionDomainForProxy(ProtectionDomain domain) {
if (domain.getCodeSource() == null) {
// no codesource to cache on
return create(domain);
}
ProtectionDomain proxyProtectionDomain = proxyProtectionDomains.get(domain.getCodeSource());
if (pro... | java | ProtectionDomain getProtectionDomainForProxy(ProtectionDomain domain) {
if (domain.getCodeSource() == null) {
// no codesource to cache on
return create(domain);
}
ProtectionDomain proxyProtectionDomain = proxyProtectionDomains.get(domain.getCodeSource());
if (pro... | [
"ProtectionDomain",
"getProtectionDomainForProxy",
"(",
"ProtectionDomain",
"domain",
")",
"{",
"if",
"(",
"domain",
".",
"getCodeSource",
"(",
")",
"==",
"null",
")",
"{",
"// no codesource to cache on",
"return",
"create",
"(",
"domain",
")",
";",
"}",
"Protecti... | Gets an enhanced protection domain for a proxy based on the given protection domain.
@param domain the given protection domain
@return protection domain enhanced with "accessDeclaredMembers" runtime permission | [
"Gets",
"an",
"enhanced",
"protection",
"domain",
"for",
"a",
"proxy",
"based",
"on",
"the",
"given",
"protection",
"domain",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProtectionDomainCache.java#L54-L70 | train |
weld/core | impl/src/main/java/org/jboss/weld/annotated/enhanced/jlr/EnhancedAnnotationImpl.java | EnhancedAnnotationImpl.create | public static <A extends Annotation> EnhancedAnnotation<A> create(SlimAnnotatedType<A> annotatedType, ClassTransformer classTransformer) {
Class<A> annotationType = annotatedType.getJavaClass();
Map<Class<? extends Annotation>, Annotation> annotationMap = new HashMap<Class<? extends Annotation>, Annot... | java | public static <A extends Annotation> EnhancedAnnotation<A> create(SlimAnnotatedType<A> annotatedType, ClassTransformer classTransformer) {
Class<A> annotationType = annotatedType.getJavaClass();
Map<Class<? extends Annotation>, Annotation> annotationMap = new HashMap<Class<? extends Annotation>, Annot... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"EnhancedAnnotation",
"<",
"A",
">",
"create",
"(",
"SlimAnnotatedType",
"<",
"A",
">",
"annotatedType",
",",
"ClassTransformer",
"classTransformer",
")",
"{",
"Class",
"<",
"A",
">",
"annotationType",
... | we can't call this method 'of', cause it won't compile on JDK7 | [
"we",
"can",
"t",
"call",
"this",
"method",
"of",
"cause",
"it",
"won",
"t",
"compile",
"on",
"JDK7"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/annotated/enhanced/jlr/EnhancedAnnotationImpl.java#L53-L62 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java | AnnotationModel.init | protected void init(EnhancedAnnotation<T> annotatedAnnotation) {
initType(annotatedAnnotation);
initValid(annotatedAnnotation);
check(annotatedAnnotation);
} | java | protected void init(EnhancedAnnotation<T> annotatedAnnotation) {
initType(annotatedAnnotation);
initValid(annotatedAnnotation);
check(annotatedAnnotation);
} | [
"protected",
"void",
"init",
"(",
"EnhancedAnnotation",
"<",
"T",
">",
"annotatedAnnotation",
")",
"{",
"initType",
"(",
"annotatedAnnotation",
")",
";",
"initValid",
"(",
"annotatedAnnotation",
")",
";",
"check",
"(",
"annotatedAnnotation",
")",
";",
"}"
] | Initializes the type and validates it | [
"Initializes",
"the",
"type",
"and",
"validates",
"it"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java#L55-L59 | train |
weld/core | impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java | AnnotationModel.initValid | protected void initValid(EnhancedAnnotation<T> annotatedAnnotation) {
this.valid = false;
for (Class<? extends Annotation> annotationType : getMetaAnnotationTypes()) {
if (annotatedAnnotation.isAnnotationPresent(annotationType)) {
this.valid = true;
}
}
... | java | protected void initValid(EnhancedAnnotation<T> annotatedAnnotation) {
this.valid = false;
for (Class<? extends Annotation> annotationType : getMetaAnnotationTypes()) {
if (annotatedAnnotation.isAnnotationPresent(annotationType)) {
this.valid = true;
}
}
... | [
"protected",
"void",
"initValid",
"(",
"EnhancedAnnotation",
"<",
"T",
">",
"annotatedAnnotation",
")",
"{",
"this",
".",
"valid",
"=",
"false",
";",
"for",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
":",
"getMetaAnnotationTypes",
... | Validates the data for correct annotation | [
"Validates",
"the",
"data",
"for",
"correct",
"annotation"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java#L73-L80 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/WeldStartup.java | WeldStartup.installFastProcessAnnotatedTypeResolver | private void installFastProcessAnnotatedTypeResolver(ServiceRegistry services) {
ClassFileServices classFileServices = services.get(ClassFileServices.class);
if (classFileServices != null) {
final GlobalObserverNotifierService observers = services.get(GlobalObserverNotifierService.class);
... | java | private void installFastProcessAnnotatedTypeResolver(ServiceRegistry services) {
ClassFileServices classFileServices = services.get(ClassFileServices.class);
if (classFileServices != null) {
final GlobalObserverNotifierService observers = services.get(GlobalObserverNotifierService.class);
... | [
"private",
"void",
"installFastProcessAnnotatedTypeResolver",
"(",
"ServiceRegistry",
"services",
")",
"{",
"ClassFileServices",
"classFileServices",
"=",
"services",
".",
"get",
"(",
"ClassFileServices",
".",
"class",
")",
";",
"if",
"(",
"classFileServices",
"!=",
"... | needs to be resolved once extension beans are deployed | [
"needs",
"to",
"be",
"resolved",
"once",
"extension",
"beans",
"are",
"deployed"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/WeldStartup.java#L369-L381 | train |
weld/core | examples/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/History.java | History.load | public String load() {
this.paginator = new Paginator();
this.codes = null;
// Perform a search
this.codes = codeFragmentManager.searchCodeFragments(this.codeFragmentPrototype, this.page, this.paginator);
return "history";
} | java | public String load() {
this.paginator = new Paginator();
this.codes = null;
// Perform a search
this.codes = codeFragmentManager.searchCodeFragments(this.codeFragmentPrototype, this.page, this.paginator);
return "history";
} | [
"public",
"String",
"load",
"(",
")",
"{",
"this",
".",
"paginator",
"=",
"new",
"Paginator",
"(",
")",
";",
"this",
".",
"codes",
"=",
"null",
";",
"// Perform a search",
"this",
".",
"codes",
"=",
"codeFragmentManager",
".",
"searchCodeFragments",
"(",
"... | Do the search, called as a "page action" | [
"Do",
"the",
"search",
"called",
"as",
"a",
"page",
"action"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/examples/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/History.java#L70-L78 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/EjbDescriptors.java | EjbDescriptors.get | public <T> InternalEjbDescriptor<T> get(String beanName) {
return cast(ejbByName.get(beanName));
} | java | public <T> InternalEjbDescriptor<T> get(String beanName) {
return cast(ejbByName.get(beanName));
} | [
"public",
"<",
"T",
">",
"InternalEjbDescriptor",
"<",
"T",
">",
"get",
"(",
"String",
"beanName",
")",
"{",
"return",
"cast",
"(",
"ejbByName",
".",
"get",
"(",
"beanName",
")",
")",
";",
"}"
] | Gets an iterator to the EJB descriptors for an EJB implementation class
@param beanClass The EJB class
@return An iterator | [
"Gets",
"an",
"iterator",
"to",
"the",
"EJB",
"descriptors",
"for",
"an",
"EJB",
"implementation",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/EjbDescriptors.java#L57-L59 | train |
weld/core | modules/ejb/src/main/java/org/jboss/weld/module/ejb/EjbDescriptors.java | EjbDescriptors.add | private <T> void add(EjbDescriptor<T> ejbDescriptor) {
InternalEjbDescriptor<T> internalEjbDescriptor = InternalEjbDescriptor.of(ejbDescriptor);
ejbByName.put(ejbDescriptor.getEjbName(), internalEjbDescriptor);
ejbByClass.put(ejbDescriptor.getBeanClass(), internalEjbDescriptor.getEjbName());
... | java | private <T> void add(EjbDescriptor<T> ejbDescriptor) {
InternalEjbDescriptor<T> internalEjbDescriptor = InternalEjbDescriptor.of(ejbDescriptor);
ejbByName.put(ejbDescriptor.getEjbName(), internalEjbDescriptor);
ejbByClass.put(ejbDescriptor.getBeanClass(), internalEjbDescriptor.getEjbName());
... | [
"private",
"<",
"T",
">",
"void",
"add",
"(",
"EjbDescriptor",
"<",
"T",
">",
"ejbDescriptor",
")",
"{",
"InternalEjbDescriptor",
"<",
"T",
">",
"internalEjbDescriptor",
"=",
"InternalEjbDescriptor",
".",
"of",
"(",
"ejbDescriptor",
")",
";",
"ejbByName",
".",... | Adds an EJB descriptor to the maps
@param ejbDescriptor The EJB descriptor to add | [
"Adds",
"an",
"EJB",
"descriptor",
"to",
"the",
"maps"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/modules/ejb/src/main/java/org/jboss/weld/module/ejb/EjbDescriptors.java#L66-L70 | train |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/WeldRuntime.java | WeldRuntime.fireEventForNonWebModules | private void fireEventForNonWebModules(Type eventType, Object event, Annotation... qualifiers) {
try {
BeanDeploymentModules modules = deploymentManager.getServices().get(BeanDeploymentModules.class);
if (modules != null) {
// fire event for non-web modules
... | java | private void fireEventForNonWebModules(Type eventType, Object event, Annotation... qualifiers) {
try {
BeanDeploymentModules modules = deploymentManager.getServices().get(BeanDeploymentModules.class);
if (modules != null) {
// fire event for non-web modules
... | [
"private",
"void",
"fireEventForNonWebModules",
"(",
"Type",
"eventType",
",",
"Object",
"event",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"try",
"{",
"BeanDeploymentModules",
"modules",
"=",
"deploymentManager",
".",
"getServices",
"(",
")",
".",
"get",
... | Fires given event for non-web modules. Used for @BeforeDestroyed and @Destroyed events. | [
"Fires",
"given",
"event",
"for",
"non",
"-",
"web",
"modules",
".",
"Used",
"for"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/WeldRuntime.java#L81-L95 | train |
weld/core | impl/src/main/java/org/jboss/weld/Container.java | Container.initialize | public static void initialize(BeanManagerImpl deploymentManager, ServiceRegistry deploymentServices) {
Container instance = new Container(RegistrySingletonProvider.STATIC_INSTANCE, deploymentManager, deploymentServices);
Container.instance.set(RegistrySingletonProvider.STATIC_INSTANCE, instance);
} | java | public static void initialize(BeanManagerImpl deploymentManager, ServiceRegistry deploymentServices) {
Container instance = new Container(RegistrySingletonProvider.STATIC_INSTANCE, deploymentManager, deploymentServices);
Container.instance.set(RegistrySingletonProvider.STATIC_INSTANCE, instance);
} | [
"public",
"static",
"void",
"initialize",
"(",
"BeanManagerImpl",
"deploymentManager",
",",
"ServiceRegistry",
"deploymentServices",
")",
"{",
"Container",
"instance",
"=",
"new",
"Container",
"(",
"RegistrySingletonProvider",
".",
"STATIC_INSTANCE",
",",
"deploymentManag... | Initialize the container for the current application deployment
@param deploymentManager
@param deploymentServices | [
"Initialize",
"the",
"container",
"for",
"the",
"current",
"application",
"deployment"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/Container.java#L90-L93 | train |
weld/core | impl/src/main/java/org/jboss/weld/Container.java | Container.cleanup | public void cleanup() {
managers.clear();
for (BeanManagerImpl beanManager : beanDeploymentArchives.values()) {
beanManager.cleanup();
}
beanDeploymentArchives.clear();
deploymentServices.cleanup();
deploymentManager.cleanup();
instance.clear(contextId... | java | public void cleanup() {
managers.clear();
for (BeanManagerImpl beanManager : beanDeploymentArchives.values()) {
beanManager.cleanup();
}
beanDeploymentArchives.clear();
deploymentServices.cleanup();
deploymentManager.cleanup();
instance.clear(contextId... | [
"public",
"void",
"cleanup",
"(",
")",
"{",
"managers",
".",
"clear",
"(",
")",
";",
"for",
"(",
"BeanManagerImpl",
"beanManager",
":",
"beanDeploymentArchives",
".",
"values",
"(",
")",
")",
"{",
"beanManager",
".",
"cleanup",
"(",
")",
";",
"}",
"beanD... | Cause the container to be cleaned up, including all registered bean
managers, and all deployment services | [
"Cause",
"the",
"container",
"to",
"be",
"cleaned",
"up",
"including",
"all",
"registered",
"bean",
"managers",
"and",
"all",
"deployment",
"services"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/Container.java#L141-L150 | train |
weld/core | impl/src/main/java/org/jboss/weld/Container.java | Container.putBeanDeployments | public void putBeanDeployments(BeanDeploymentArchiveMapping bdaMapping) {
for (Entry<BeanDeploymentArchive, BeanManagerImpl> entry : bdaMapping.getBdaToBeanManagerMap().entrySet()) {
beanDeploymentArchives.put(entry.getKey(), entry.getValue());
addBeanManager(entry.getValue());
}... | java | public void putBeanDeployments(BeanDeploymentArchiveMapping bdaMapping) {
for (Entry<BeanDeploymentArchive, BeanManagerImpl> entry : bdaMapping.getBdaToBeanManagerMap().entrySet()) {
beanDeploymentArchives.put(entry.getKey(), entry.getValue());
addBeanManager(entry.getValue());
}... | [
"public",
"void",
"putBeanDeployments",
"(",
"BeanDeploymentArchiveMapping",
"bdaMapping",
")",
"{",
"for",
"(",
"Entry",
"<",
"BeanDeploymentArchive",
",",
"BeanManagerImpl",
">",
"entry",
":",
"bdaMapping",
".",
"getBdaToBeanManagerMap",
"(",
")",
".",
"entrySet",
... | Add sub-deployment units to the container
@param bdaMapping | [
"Add",
"sub",
"-",
"deployment",
"units",
"to",
"the",
"container"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/Container.java#L204-L209 | train |
weld/core | impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java | ObserverMethodImpl.checkObserverMethod | private <Y> void checkObserverMethod(EnhancedAnnotatedMethod<T, Y> annotated) {
// Make sure exactly one and only one parameter is annotated with Observes or ObservesAsync
List<EnhancedAnnotatedParameter<?, Y>> eventObjects = annotated.getEnhancedParameters(Observes.class);
eventObjects.addAll(a... | java | private <Y> void checkObserverMethod(EnhancedAnnotatedMethod<T, Y> annotated) {
// Make sure exactly one and only one parameter is annotated with Observes or ObservesAsync
List<EnhancedAnnotatedParameter<?, Y>> eventObjects = annotated.getEnhancedParameters(Observes.class);
eventObjects.addAll(a... | [
"private",
"<",
"Y",
">",
"void",
"checkObserverMethod",
"(",
"EnhancedAnnotatedMethod",
"<",
"T",
",",
"Y",
">",
"annotated",
")",
"{",
"// Make sure exactly one and only one parameter is annotated with Observes or ObservesAsync",
"List",
"<",
"EnhancedAnnotatedParameter",
"... | Performs validation of the observer method for compliance with the specifications. | [
"Performs",
"validation",
"of",
"the",
"observer",
"method",
"for",
"compliance",
"with",
"the",
"specifications",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java#L199-L232 | train |
weld/core | impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java | ObserverMethodImpl.sendEvent | protected void sendEvent(final T event) {
if (isStatic) {
sendEvent(event, null, null);
} else {
CreationalContext<X> creationalContext = null;
try {
Object receiver = getReceiverIfExists(null);
if (receiver == null && reception != Rece... | java | protected void sendEvent(final T event) {
if (isStatic) {
sendEvent(event, null, null);
} else {
CreationalContext<X> creationalContext = null;
try {
Object receiver = getReceiverIfExists(null);
if (receiver == null && reception != Rece... | [
"protected",
"void",
"sendEvent",
"(",
"final",
"T",
"event",
")",
"{",
"if",
"(",
"isStatic",
")",
"{",
"sendEvent",
"(",
"event",
",",
"null",
",",
"null",
")",
";",
"}",
"else",
"{",
"CreationalContext",
"<",
"X",
">",
"creationalContext",
"=",
"nul... | Invokes the observer method immediately passing the event.
@param event The event to notify observer with | [
"Invokes",
"the",
"observer",
"method",
"immediately",
"passing",
"the",
"event",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java#L294-L316 | train |
weld/core | impl/src/main/java/org/jboss/weld/contexts/cache/RequestScopedCache.java | RequestScopedCache.endRequest | public static void endRequest() {
final List<RequestScopedItem> result = CACHE.get();
if (result != null) {
CACHE.remove();
for (final RequestScopedItem item : result) {
item.invalidate();
}
}
} | java | public static void endRequest() {
final List<RequestScopedItem> result = CACHE.get();
if (result != null) {
CACHE.remove();
for (final RequestScopedItem item : result) {
item.invalidate();
}
}
} | [
"public",
"static",
"void",
"endRequest",
"(",
")",
"{",
"final",
"List",
"<",
"RequestScopedItem",
">",
"result",
"=",
"CACHE",
".",
"get",
"(",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"CACHE",
".",
"remove",
"(",
")",
";",
"for",
"... | ends the request and clears the cache. This can be called before the request is over,
in which case the cache will be unavailable for the rest of the request. | [
"ends",
"the",
"request",
"and",
"clears",
"the",
"cache",
".",
"This",
"can",
"be",
"called",
"before",
"the",
"request",
"is",
"over",
"in",
"which",
"case",
"the",
"cache",
"will",
"be",
"unavailable",
"for",
"the",
"rest",
"of",
"the",
"request",
"."... | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/cache/RequestScopedCache.java#L83-L91 | train |
weld/core | impl/src/main/java/org/jboss/weld/annotated/runtime/InvokableAnnotatedMethod.java | InvokableAnnotatedMethod.invokeOnInstance | public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
final Map<Class<?>, Method> methods = this.methods;
Method method = methods.get(instance.getClass());
... | java | public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
final Map<Class<?>, Method> methods = this.methods;
Method method = methods.get(instance.getClass());
... | [
"public",
"<",
"X",
">",
"X",
"invokeOnInstance",
"(",
"Object",
"instance",
",",
"Object",
"...",
"parameters",
")",
"throws",
"IllegalArgumentException",
",",
"SecurityException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"NoSuchMethodExcep... | Invokes the method on the class of the passed instance, not the declaring
class. Useful with proxies
@param instance The instance to invoke
@param manager The Bean manager
@return A reference to the instance | [
"Invokes",
"the",
"method",
"on",
"the",
"class",
"of",
"the",
"passed",
"instance",
"not",
"the",
"declaring",
"class",
".",
"Useful",
"with",
"proxies"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/annotated/runtime/InvokableAnnotatedMethod.java#L71-L87 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java | ApiAbstraction.annotationTypeForName | @SuppressWarnings("unchecked")
protected Class<? extends Annotation> annotationTypeForName(String name) {
try {
return (Class<? extends Annotation>) resourceLoader.classForName(name);
} catch (ResourceLoadingException cnfe) {
return DUMMY_ANNOTATION;
}
} | java | @SuppressWarnings("unchecked")
protected Class<? extends Annotation> annotationTypeForName(String name) {
try {
return (Class<? extends Annotation>) resourceLoader.classForName(name);
} catch (ResourceLoadingException cnfe) {
return DUMMY_ANNOTATION;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationTypeForName",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
")",
"reso... | Initializes an annotation class
@param name The name of the annotation class
@return The instance of the annotation. Returns a dummy if the class was
not found | [
"Initializes",
"an",
"annotation",
"class"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java#L74-L81 | train |
weld/core | impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java | ApiAbstraction.classForName | protected Class<?> classForName(String name) {
try {
return resourceLoader.classForName(name);
} catch (ResourceLoadingException cnfe) {
return DUMMY_CLASS;
}
} | java | protected Class<?> classForName(String name) {
try {
return resourceLoader.classForName(name);
} catch (ResourceLoadingException cnfe) {
return DUMMY_CLASS;
}
} | [
"protected",
"Class",
"<",
"?",
">",
"classForName",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"resourceLoader",
".",
"classForName",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"ResourceLoadingException",
"cnfe",
")",
"{",
"return",
"DUMMY_CLASS"... | Initializes a type
@param name The name of the class
@return The instance of the class. Returns a dummy if the class was not
found. | [
"Initializes",
"a",
"type"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java#L90-L96 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.addInterface | public void addInterface(Class<?> newInterface) {
if (!newInterface.isInterface()) {
throw new IllegalArgumentException(newInterface + " is not an interface");
}
additionalInterfaces.add(newInterface);
} | java | public void addInterface(Class<?> newInterface) {
if (!newInterface.isInterface()) {
throw new IllegalArgumentException(newInterface + " is not an interface");
}
additionalInterfaces.add(newInterface);
} | [
"public",
"void",
"addInterface",
"(",
"Class",
"<",
"?",
">",
"newInterface",
")",
"{",
"if",
"(",
"!",
"newInterface",
".",
"isInterface",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"newInterface",
"+",
"\" is not an interface\"",
"... | Adds an additional interface that the proxy should implement. The default
implementation will be to forward invocations to the bean instance.
@param newInterface an interface | [
"Adds",
"an",
"additional",
"interface",
"that",
"the",
"proxy",
"should",
"implement",
".",
"The",
"default",
"implementation",
"will",
"be",
"to",
"forward",
"invocations",
"to",
"the",
"bean",
"instance",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L309-L314 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.create | public T create(BeanInstance beanInstance) {
final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this);
((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean));
return proxy;
} | java | public T create(BeanInstance beanInstance) {
final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this);
((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean));
return proxy;
} | [
"public",
"T",
"create",
"(",
"BeanInstance",
"beanInstance",
")",
"{",
"final",
"T",
"proxy",
"=",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"?",
"run",
"(",
")",
":",
"AccessController",
".",
"doPrivileged",
"(",
"this",
")... | Method to create a new proxy that wraps the bean instance.
@param beanInstance the bean instance
@return a new proxy object | [
"Method",
"to",
"create",
"a",
"new",
"proxy",
"that",
"wraps",
"the",
"bean",
"instance",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L322-L326 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.getProxyClass | public Class<T> getProxyClass() {
String suffix = "_$$_Weld" + getProxyNameSuffix();
String proxyClassName = getBaseProxyName();
if (!proxyClassName.endsWith(suffix)) {
proxyClassName = proxyClassName + suffix;
}
if (proxyClassName.startsWith(JAVA)) {
prox... | java | public Class<T> getProxyClass() {
String suffix = "_$$_Weld" + getProxyNameSuffix();
String proxyClassName = getBaseProxyName();
if (!proxyClassName.endsWith(suffix)) {
proxyClassName = proxyClassName + suffix;
}
if (proxyClassName.startsWith(JAVA)) {
prox... | [
"public",
"Class",
"<",
"T",
">",
"getProxyClass",
"(",
")",
"{",
"String",
"suffix",
"=",
"\"_$$_Weld\"",
"+",
"getProxyNameSuffix",
"(",
")",
";",
"String",
"proxyClassName",
"=",
"getBaseProxyName",
"(",
")",
";",
"if",
"(",
"!",
"proxyClassName",
".",
... | Produces or returns the existing proxy class. The operation is thread-safe.
@return always the class of the proxy | [
"Produces",
"or",
"returns",
"the",
"existing",
"proxy",
"class",
".",
"The",
"operation",
"is",
"thread",
"-",
"safe",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L352-L383 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.setBeanInstance | public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) {
if (proxy instanceof ProxyObject) {
ProxyObject proxyView = (ProxyObject) proxy;
proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean));
}
} | java | public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) {
if (proxy instanceof ProxyObject) {
ProxyObject proxyView = (ProxyObject) proxy;
proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean));
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"setBeanInstance",
"(",
"String",
"contextId",
",",
"T",
"proxy",
",",
"BeanInstance",
"beanInstance",
",",
"Bean",
"<",
"?",
">",
"bean",
")",
"{",
"if",
"(",
"proxy",
"instanceof",
"ProxyObject",
")",
"{",
"Pr... | Convenience method to set the underlying bean instance for a proxy.
@param proxy the proxy instance
@param beanInstance the instance of the bean | [
"Convenience",
"method",
"to",
"set",
"the",
"underlying",
"bean",
"instance",
"for",
"a",
"proxy",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L400-L405 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.addConstructors | protected void addConstructors(ClassFile proxyClassType, List<DeferredBytecode> initialValueBytecode) {
try {
if (getBeanType().isInterface()) {
ConstructorUtils.addDefaultConstructor(proxyClassType, initialValueBytecode, !useConstructedFlag());
} else {
b... | java | protected void addConstructors(ClassFile proxyClassType, List<DeferredBytecode> initialValueBytecode) {
try {
if (getBeanType().isInterface()) {
ConstructorUtils.addDefaultConstructor(proxyClassType, initialValueBytecode, !useConstructedFlag());
} else {
b... | [
"protected",
"void",
"addConstructors",
"(",
"ClassFile",
"proxyClassType",
",",
"List",
"<",
"DeferredBytecode",
">",
"initialValueBytecode",
")",
"{",
"try",
"{",
"if",
"(",
"getBeanType",
"(",
")",
".",
"isInterface",
"(",
")",
")",
"{",
"ConstructorUtils",
... | Adds a constructor for the proxy for each constructor declared by the base
bean type.
@param proxyClassType the Javassist class for the proxy
@param initialValueBytecode | [
"Adds",
"a",
"constructor",
"for",
"the",
"proxy",
"for",
"each",
"constructor",
"declared",
"by",
"the",
"base",
"bean",
"type",
"."
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L521-L546 | train |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.resolveClassLoaderForBeanProxy | public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) {
Class<?> superClass = typeInfo.getSuperClass();
if (superClass.getName().startsWith(JAVA)) {
ClassLoader cl = proxyServices.getClassLoader(proxie... | java | public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) {
Class<?> superClass = typeInfo.getSuperClass();
if (superClass.getName().startsWith(JAVA)) {
ClassLoader cl = proxyServices.getClassLoader(proxie... | [
"public",
"static",
"ClassLoader",
"resolveClassLoaderForBeanProxy",
"(",
"String",
"contextId",
",",
"Class",
"<",
"?",
">",
"proxiedType",
",",
"TypeInfo",
"typeInfo",
",",
"ProxyServices",
"proxyServices",
")",
"{",
"Class",
"<",
"?",
">",
"superClass",
"=",
... | Figures out the correct class loader to use for a proxy for a given bean | [
"Figures",
"out",
"the",
"correct",
"class",
"loader",
"to",
"use",
"for",
"a",
"proxy",
"for",
"a",
"given",
"bean"
] | 567a2eaf95b168597d23a56be89bf05a7834b2aa | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L902-L912 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.