idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
26,500 | private boolean hasAbstractPackagePrivateSuperClassWithImplementation ( Class < ? > clazz , BridgeMethod bridgeMethod ) { Class < ? > superClass = clazz . getSuperclass ( ) ; while ( superClass != null ) { if ( Modifier . isAbstract ( superClass . getModifiers ( ) ) && Reflections . isPackagePrivate ( superClass . getM... | Returns true if super class of the parameter exists and is abstract and package private . In such case we want to omit such method . |
26,501 | protected void addSpecialMethods ( ClassFile proxyClassType , ClassMethod staticConstructor ) { try { for ( Method method : LifecycleMixin . class . getMethods ( ) ) { BeanLogger . LOG . addingMethodToProxy ( method ) ; MethodInformation methodInfo = new RuntimeMethodInformation ( method ) ; createInterceptorBody ( pro... | Adds methods requiring special implementations rather than just delegation . |
26,502 | public static void checkDelegateType ( Decorator < ? > decorator ) { Set < Type > types = new HierarchyDiscovery ( decorator . getDelegateType ( ) ) . getTypeClosure ( ) ; for ( Type decoratedType : decorator . getDecoratedTypes ( ) ) { if ( ! types . contains ( decoratedType ) ) { throw BeanLogger . LOG . delegateMust... | Check whether the delegate type implements or extends all decorated types . |
26,503 | public static < T > void checkAbstractMethods ( Set < Type > decoratedTypes , EnhancedAnnotatedType < T > type , BeanManagerImpl beanManager ) { if ( decoratedTypes == null ) { decoratedTypes = new HashSet < Type > ( type . getInterfaceClosure ( ) ) ; decoratedTypes . remove ( Serializable . class ) ; } Set < MethodSig... | Check all abstract methods are declared by the decorated types . |
26,504 | public void checkSpecialization ( ) { if ( isSpecializing ( ) ) { boolean isNameDefined = getAnnotated ( ) . isAnnotationPresent ( Named . class ) ; String previousSpecializedBeanName = null ; for ( AbstractBean < ? , ? > specializedBean : getSpecializedBeans ( ) ) { String name = specializedBean . getName ( ) ; if ( p... | Validates specialization if this bean specializes another bean . |
26,505 | public void fireEvent ( Type eventType , Object event , Annotation ... qualifiers ) { final EventMetadata metadata = new EventMetadataImpl ( eventType , null , qualifiers ) ; notifier . fireEvent ( eventType , event , metadata , qualifiers ) ; } | Fire an event and notify observers that belong to this module . |
26,506 | @ SuppressWarnings ( "unchecked" ) public static < T > T getJlsDefaultValue ( Class < T > type ) { if ( ! type . isPrimitive ( ) ) { return null ; } return ( T ) JLS_PRIMITIVE_DEFAULT_VALUES . get ( type ) ; } | See also JLS8 4 . 12 . 5 Initial Values of Variables . |
26,507 | public void afterDeploymentValidation ( @ Priority ( 1 ) AfterDeploymentValidation event , BeanManager beanManager ) { BeanManagerImpl manager = BeanManagerProxy . unwrap ( beanManager ) ; probe . init ( manager ) ; if ( isJMXSupportEnabled ( manager ) ) { try { MBeanServer mbs = ManagementFactory . getPlatformMBeanSer... | any possible bean invocations from other ADV observers |
26,508 | static boolean matchPath ( String [ ] tokenizedPattern , String [ ] strDirs , boolean isCaseSensitive ) { int patIdxStart = 0 ; int patIdxEnd = tokenizedPattern . length - 1 ; int strIdxStart = 0 ; int strIdxEnd = strDirs . length - 1 ; while ( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd ) { String patDir = to... | Core implementation of matchPath . It is isolated so that it can be called from TokenizedPattern . |
26,509 | static String [ ] tokenize ( String str ) { char sep = '.' ; int start = 0 ; int len = str . length ( ) ; int count = 0 ; for ( int pos = 0 ; pos < len ; pos ++ ) { if ( str . charAt ( pos ) == sep ) { if ( pos != start ) { count ++ ; } start = pos + 1 ; } } if ( len != start ) { count ++ ; } String [ ] l = new String ... | Tokenize the the string as a package hierarchy |
26,510 | 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_DES... | Ends interception context if it was previously stated . This is indicated by a local variable with index 0 . |
26,511 | @ 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 ( ) ; final BeanStore beanSt... | Get the bean if it exists in the contexts . |
26,512 | protected void destroy ( ) { ContextLogger . LOG . contextCleared ( this ) ; final BeanStore beanStore = getBeanStore ( ) ; if ( beanStore == null ) { throw ContextLogger . LOG . noBeanStoreAvailable ( this ) ; } for ( BeanIdentifier id : beanStore ) { destroyContextualInstance ( beanStore . get ( id ) ) ; } beanStore ... | Destroys the context |
26,513 | 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 ( ) ) ; } | Add all elements in the iterable to the collection . |
26,514 | 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 ( ... | Producers returned from this method are not validated . Internal use only . |
26,515 | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive ( ) { WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive ( ADDITIONAL_BDA_ID , Collections . synchronizedSet ( new HashSet < String > ( ) ) , null ) ; additionalBda . getServices ( ) . addAll ( getServices ( ) . entrySet ( ) ... | Additional bean deployment archives are used for extentions synthetic annotated types and beans which do not come from a bean archive . |
26,516 | protected void setBeanDeploymentArchivesAccessibility ( ) { for ( WeldBeanDeploymentArchive beanDeploymentArchive : beanDeploymentArchives ) { Set < WeldBeanDeploymentArchive > accessibleArchives = new HashSet < > ( ) ; for ( WeldBeanDeploymentArchive candidate : beanDeploymentArchives ) { if ( candidate . equals ( bea... | By default all bean archives see each other . |
26,517 | static Type parseType ( String value , ResourceLoader resourceLoader ) { value = value . trim ( ) ; if ( value . equals ( WILDCARD ) ) { return WildcardTypeImpl . defaultInstance ( ) ; } if ( value . startsWith ( WILDCARD_EXTENDS ) ) { Type upperBound = parseType ( value . substring ( WILDCARD_EXTENDS . length ( ) , va... | Type variables are not supported . |
26,518 | public static boolean isPortletEnvSupported ( ) { if ( enabled == null ) { synchronized ( PortletSupport . class ) { if ( enabled == null ) { try { PortletSupport . class . getClassLoader ( ) . loadClass ( "javax.portlet.PortletContext" ) ; enabled = true ; } catch ( Throwable ignored ) { enabled = false ; } } } } retu... | Is portlet env supported . |
26,519 | public static BeanManager getBeanManager ( Object ctx ) { return ( BeanManager ) javax . portlet . PortletContext . class . cast ( ctx ) . getAttribute ( WeldServletLifecycle . BEAN_MANAGER_ATTRIBUTE_NAME ) ; } | Get bean manager from portlet context . |
26,520 | private < T > List < Class < ? > > filter ( List < Class < ? > > enabledClasses , List < Class < ? > > globallyEnabledClasses , LogMessageCallback logMessageCallback , BeanDeployment deployment ) { for ( Iterator < Class < ? > > iterator = enabledClasses . iterator ( ) ; iterator . hasNext ( ) ; ) { Class < ? > enabled... | Filter out interceptors and decorators which are also enabled globally . |
26,521 | public F resolve ( R resolvable , boolean cache ) { R wrappedResolvable = wrap ( resolvable ) ; if ( cache ) { return resolved . getValue ( wrappedResolvable ) ; } else { return resolverFunction . apply ( wrappedResolvable ) ; } } | Get the possible beans for the given element |
26,522 | 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 ; } | Gets the matching beans for binding criteria from a list of beans |
26,523 | public < X > Set < DisposalMethod < X , ? > > resolveDisposalBeans ( Set < Type > types , Set < Annotation > qualifiers , AbstractClassBean < X > declaringBean ) { Set < DisposalMethod < X , ? > > beans = cast ( disposalMethodResolver . resolve ( new ResolvableBuilder ( manager ) . addTypes ( types ) . addQualifiers ( ... | 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 . |
26,524 | private static < T > Set < Type > getSessionBeanTypes ( EnhancedAnnotated < T , ? > annotated , EjbDescriptor < T > ejbDescriptor ) { ImmutableSet . Builder < Type > types = ImmutableSet . builder ( ) ; Map < Class < ? > , Type > typeMap = new LinkedHashMap < Class < ? > , Type > ( ) ; HierarchyDiscovery beanClassDisco... | Bean types of a session bean . |
26,525 | 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 ( ... | Creates a simple annotation defined Enterprise Web Bean using the annotations specified on type |
26,526 | protected void checkConflictingRoles ( ) { if ( getType ( ) . isAnnotationPresent ( Interceptor . class ) ) { throw BeanLogger . LOG . ejbCannotBeInterceptor ( getType ( ) ) ; } if ( getType ( ) . isAnnotationPresent ( Decorator . class ) ) { throw BeanLogger . LOG . ejbCannotBeDecorator ( getType ( ) ) ; } } | Validates for non - conflicting roles |
26,527 | protected void checkScopeAllowed ( ) { if ( ejbDescriptor . isStateless ( ) && ! isDependent ( ) ) { throw BeanLogger . LOG . scopeNotAllowedOnStatelessSessionBean ( getScope ( ) , getType ( ) ) ; } if ( ejbDescriptor . isSingleton ( ) && ! ( isDependent ( ) || getScope ( ) . equals ( ApplicationScoped . class ) ) ) { ... | Check that the scope type is allowed by the stereotypes on the bean and the bean type |
26,528 | protected void checkObserverMethods ( ) { Collection < EnhancedAnnotatedMethod < ? , ? super T > > observerMethods = BeanMethods . getObserverMethods ( this . getEnhancedAnnotated ( ) ) ; Collection < EnhancedAnnotatedMethod < ? , ? super T > > asyncObserverMethods = BeanMethods . getAsyncObserverMethods ( this . getEn... | If there are any observer methods they must be static or business methods . |
26,529 | 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 ) ; } | Creates an instance of a NewSimpleBean from an annotated class |
26,530 | 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 ( ) ) { reference . remove ( ) ; }... | Looks up the EJB in the container and executes the method on it |
26,531 | 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 ( Transaction... | Defers an event for processing in a later phase of the current transaction . |
26,532 | 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 ; indexBuilt . set ( true ) ; return ; } List <... | Note that the index can only be built once . |
26,533 | 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 ( ) ) { Even... | Constructs a new FastEvent instance |
26,534 | 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 . |
26,535 | 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 ( source . toArray ( ) ) ; } | 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 . |
26,536 | public static Set < Annotation > filterInterceptorBindings ( BeanManagerImpl beanManager , Collection < Annotation > annotations ) { Set < Annotation > interceptorBindings = new InterceptorBindingSet ( beanManager ) ; for ( Annotation annotation : annotations ) { if ( beanManager . isInterceptorBinding ( annotation . a... | Extracts a set of interceptor bindings from a collection of annotations . |
26,537 | public static Set < Annotation > flattenInterceptorBindings ( EnhancedAnnotatedType < ? > clazz , BeanManagerImpl beanManager , Collection < Annotation > annotations , boolean addTopLevelInterceptorBindings , boolean addInheritedInterceptorBindings ) { Set < Annotation > flattenInterceptorBindings = new InterceptorBind... | Extracts a flat set of interception bindings from a given set of interceptor bindings . |
26,538 | protected void validateRIBean ( CommonBean < ? > bean , BeanManagerImpl beanManager , Collection < CommonBean < ? > > specializedBeans ) { validateGeneralBean ( bean , beanManager ) ; if ( bean instanceof NewBean ) { return ; } if ( bean instanceof DecorableBean ) { validateDecorators ( beanManager , ( DecorableBean < ... | Validate an RIBean . This includes validating whether two beans specialize the same bean |
26,539 | public void validateInjectionPoint ( InjectionPoint ij , BeanManagerImpl beanManager ) { validateInjectionPointForDefinitionErrors ( ij , ij . getBean ( ) , beanManager ) ; validateMetadataInjectionPoint ( ij , ij . getBean ( ) , ValidatorLogger . INJECTION_INTO_NON_BEAN ) ; validateEventMetadataInjectionPoint ( ij ) ;... | Validate an injection point |
26,540 | private static void validatePseudoScopedBean ( Bean < ? > bean , BeanManagerImpl beanManager ) { if ( bean . getInjectionPoints ( ) . isEmpty ( ) ) { return ; } reallyValidatePseudoScopedBean ( bean , beanManager , new LinkedHashSet < Object > ( ) , new HashSet < Bean < ? > > ( ) ) ; } | Checks to make sure that pseudo scoped beans ( i . e . |
26,541 | private static void reallyValidatePseudoScopedBean ( Bean < ? > bean , BeanManagerImpl beanManager , Set < Object > dependencyPath , Set < Bean < ? > > validatedBeans ) { if ( dependencyPath . contains ( bean ) ) { List < Object > realDependencyPath = new ArrayList < Object > ( dependencyPath ) ; realDependencyPath . a... | 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 |
26,542 | public static InterceptionContext forConstructorInterception ( InterceptionModel interceptionModel , CreationalContext < ? > ctx , BeanManagerImpl manager , SlimAnnotatedType < ? > type ) { return of ( interceptionModel , ctx , manager , null , type ) ; } | The context returned by this method may be later reused for other interception types . |
26,543 | private Set < QualifierInstance > getRequiredQualifiers ( EnhancedAnnotatedParameter < ? , ? super X > enhancedDisposedParameter ) { Set < Annotation > disposedParameterQualifiers = enhancedDisposedParameter . getMetaAnnotations ( Qualifier . class ) ; if ( disposedParameterQualifiers . isEmpty ( ) ) { disposedParamete... | A disposer method is bound to a producer if the producer is assignable to the disposed parameter . |
26,544 | public static Type [ ] getActualTypeArguments ( Class < ? > clazz ) { Type type = Types . getCanonicalType ( clazz ) ; if ( type instanceof ParameterizedType ) { return ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; } else { return EMPTY_TYPES ; } } | Gets the actual type arguments of a class |
26,545 | public static Type [ ] getActualTypeArguments ( Type type ) { Type resolvedType = Types . getCanonicalType ( type ) ; if ( resolvedType instanceof ParameterizedType ) { return ( ( ParameterizedType ) resolvedType ) . getActualTypeArguments ( ) ; } else { return EMPTY_TYPES ; } } | Gets the actual type arguments of a Type |
26,546 | 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 ; } } | Tries to load a class using the specified ResourceLoader . Returns null if the class is not found . |
26,547 | 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 ; } | 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 . |
26,548 | 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 ) ; } } | The main method called from the command line . |
26,549 | public void release ( Contextual < T > contextual , T instance ) { synchronized ( dependentInstances ) { for ( ContextualInstance < ? > dependentInstance : dependentInstances ) { if ( contextual == null || ! ( dependentInstance . getContextual ( ) . equals ( contextual ) ) ) { destroy ( dependentInstance ) ; } } } if (... | should not be public |
26,550 | public boolean destroyDependentInstance ( T instance ) { synchronized ( dependentInstances ) { for ( Iterator < ContextualInstance < ? > > iterator = dependentInstances . iterator ( ) ; iterator . hasNext ( ) ; ) { ContextualInstance < ? > contextualInstance = iterator . next ( ) ; if ( contextualInstance . getInstance... | Destroys dependent instance |
26,551 | protected T checkReturnValue ( T instance ) { if ( instance == null && ! isDependent ( ) ) { throw BeanLogger . LOG . nullNotAllowedFromProducer ( getProducer ( ) , Formats . formatAsStackTraceElement ( getAnnotated ( ) . getJavaMember ( ) ) ) ; } if ( instance == null ) { InjectionPoint injectionPoint = beanManager . ... | Validates the return value |
26,552 | public static < K , V > Map < K , V > copyOf ( Map < K , V > map ) { Preconditions . checkNotNull ( map ) ; return ImmutableMap . < K , V > builder ( ) . putAll ( map ) . build ( ) ; } | Creates an immutable map . A copy of the given map is used . As a result it is safe to modify the source map afterwards . |
26,553 | public static < K , V > Map < K , V > of ( K key , V value ) { return new ImmutableMapEntry < K , V > ( key , value ) ; } | Creates an immutable singleton instance . |
26,554 | public static String formatAsStackTraceElement ( InjectionPoint ij ) { Member member ; if ( ij . getAnnotated ( ) instanceof AnnotatedField ) { AnnotatedField < ? > annotatedField = ( AnnotatedField < ? > ) ij . getAnnotated ( ) ; member = annotatedField . getJavaMember ( ) ; } else if ( ij . getAnnotated ( ) instanceo... | See also WELD - 1454 . |
26,555 | public static int getLineNumber ( Member member ) { if ( ! ( member instanceof Method || member instanceof Constructor ) ) { return 0 ; } if ( ! Reflections . isClassLoadable ( BCEL_CLASS , WeldClassLoaderResourceLoader . INSTANCE ) ) { return 0 ; } String classFile = member . getDeclaringClass ( ) . getName ( ) . repl... | Try to get the line number associated with the given member . |
26,556 | 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 . isPublic ( modifiers ) ) { r... | Parses a reflection modifier to a list of string |
26,557 | private boolean initCheckTypeModifiers ( ) { Class < ? > classInfoclass = Reflections . loadClass ( CLASSINFO_CLASS_NAME , new ClassLoaderResourceLoader ( classFileServices . getClass ( ) . getClassLoader ( ) ) ) ; if ( classInfoclass != null ) { try { Method setFlags = AccessController . doPrivileged ( GetDeclaredMeth... | checking availability of ClassInfo . setFlags method is just workaround for JANDEX - 37 |
26,558 | 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 > ( cr... | Creates a producer method Web Bean |
26,559 | public static void addLoadInstruction ( CodeAttribute code , String type , int variable ) { char tp = type . charAt ( 0 ) ; if ( tp != 'L' && tp != '[' ) { switch ( tp ) { case 'J' : code . lload ( variable ) ; break ; case 'D' : code . dload ( variable ) ; break ; case 'F' : code . fload ( variable ) ; break ; default... | Adds the correct load instruction based on the type descriptor |
26,560 | 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 ) ; } else { char type = classType . c... | Pushes a class type onto the stack from the string representation This can also handle primitives |
26,561 | 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 ) ) { t... | Validates the binding types |
26,562 | private void initBeanNameDefaulted ( EnhancedAnnotation < T > annotatedAnnotation ) { if ( annotatedAnnotation . isAnnotationPresent ( Named . class ) ) { if ( ! "" . equals ( annotatedAnnotation . getAnnotation ( Named . class ) . value ( ) ) ) { throw MetadataLogger . LOG . valueOnNamedStereotype ( annotatedAnnotatio... | Initializes the bean name defaulted |
26,563 | private void initDefaultScopeType ( EnhancedAnnotation < T > annotatedAnnotation ) { Set < Annotation > scopeTypes = new HashSet < Annotation > ( ) ; scopeTypes . addAll ( annotatedAnnotation . getMetaAnnotations ( Scope . class ) ) ; scopeTypes . addAll ( annotatedAnnotation . getMetaAnnotations ( NormalScope . class ... | Initializes the default scope type |
26,564 | public static Type boxedType ( Type type ) { if ( type instanceof Class < ? > ) { return boxedClass ( ( Class < ? > ) type ) ; } else { return type ; } } | Gets the boxed type of a class |
26,565 | public static Type getCanonicalType ( Class < ? > clazz ) { if ( clazz . isArray ( ) ) { Class < ? > componentType = clazz . getComponentType ( ) ; Type resolvedComponentType = getCanonicalType ( componentType ) ; if ( componentType != resolvedComponentType ) { return new GenericArrayTypeImpl ( resolvedComponentType ) ... | Returns a canonical type for a given class . |
26,566 | public static boolean isArray ( Type type ) { return ( type instanceof GenericArrayType ) || ( type instanceof Class < ? > && ( ( Class < ? > ) type ) . isArray ( ) ) ; } | Determines whether the given type is an array type . |
26,567 | 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 ( ) ) { return clazz . getComponentTyp... | Determines the component type for a given array type . |
26,568 | 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 ( ) ; if ( bounds == null || bounds . length ==... | Determines whether the given array only contains unbounded type variables or Object . class . |
26,569 | 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 instanceof WeldCreationalContext < ? > )... | Overridden method always creating a new instance |
26,570 | public void createEnablement ( ) { GlobalEnablementBuilder builder = beanManager . getServices ( ) . get ( GlobalEnablementBuilder . class ) ; ModuleEnablement enablement = builder . createModuleEnablement ( this ) ; beanManager . setEnabled ( enablement ) ; if ( BootstrapLogger . LOG . isDebugEnabled ( ) ) { Bootstrap... | Initializes module enablement . |
26,571 | public static < T > DecoratorImpl < T > of ( BeanAttributes < T > attributes , EnhancedAnnotatedType < T > clazz , BeanManagerImpl beanManager ) { return new DecoratorImpl < T > ( attributes , clazz , beanManager ) ; } | Creates a decorator bean |
26,572 | protected void merge ( Set < Annotation > stereotypeAnnotations ) { final MetaAnnotationStore store = manager . getServices ( ) . get ( MetaAnnotationStore . class ) ; for ( Annotation stereotypeAnnotation : stereotypeAnnotations ) { StereotypeModel < ? > stereotype = store . getStereotype ( stereotypeAnnotation . anno... | Perform the merge |
26,573 | public void run ( ) { try { threadContext . activate ( ) ; runnable . run ( ) ; } finally { threadContext . invalidate ( ) ; threadContext . deactivate ( ) ; } } | Set up the ThreadContext and delegate . |
26,574 | protected AbstractBeanDeployer < E > deploySpecialized ( ) { for ( DecoratorImpl < ? > bean : getEnvironment ( ) . getDecorators ( ) ) { bean . initialize ( getEnvironment ( ) ) ; containerLifecycleEvents . fireProcessBean ( getManager ( ) , bean ) ; manager . addDecorator ( bean ) ; BootstrapLogger . LOG . foundDecora... | interceptors decorators and observers go first |
26,575 | public static void validateObserverMethod ( ObserverMethod < ? > observerMethod , BeanManager beanManager , ObserverMethod < ? > originalObserverMethod ) { Set < Annotation > qualifiers = observerMethod . getObservedQualifiers ( ) ; if ( observerMethod . getBeanClass ( ) == null ) { throw EventLogger . LOG . observerMe... | Validates given external observer method . |
26,576 | 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 ; } return true ; } | This logic is shared for all actual types i . e . raw types parameterized types and generic array types . |
26,577 | public static CombinedInterceptorAndDecoratorStackMethodHandler peekIfNotEmpty ( ) { Stack stack = interceptionContexts . get ( ) ; if ( stack == null ) { return null ; } return stack . peek ( ) ; } | Peeks the current top of the stack or returns null if the stack is empty |
26,578 | public static Stack getStack ( ) { Stack stack = interceptionContexts . get ( ) ; if ( stack == null ) { stack = new Stack ( interceptionContexts ) ; interceptionContexts . set ( stack ) ; } return stack ; } | Gets the current Stack . If the stack is not set a new empty instance is created and set . |
26,579 | public static boolean isTypesProxyable ( Iterable < ? extends Type > types , ServiceRegistry services ) { return getUnproxyableTypesException ( types , services ) == null ; } | Indicates if a set of types are all proxyable |
26,580 | 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 ; } | Add all elements in the iterator to the collection . |
26,581 | public static < T > Iterator < T > concat ( Iterator < ? extends Iterator < ? extends T > > iterators ) { Preconditions . checkArgumentNotNull ( iterators , "iterators" ) ; return new CombinedIterator < T > ( iterators ) ; } | Combine the iterators into a single one . |
26,582 | HtmlTag attr ( String name , String value ) { if ( attrs == null ) { attrs = new HashMap < > ( ) ; } attrs . put ( name , value ) ; return this ; } | Attribute name and value are not escaped or modified in any way . |
26,583 | public void clearAnnotationData ( Class < ? extends Annotation > annotationClass ) { stereotypes . invalidate ( annotationClass ) ; scopes . invalidate ( annotationClass ) ; qualifiers . invalidate ( annotationClass ) ; interceptorBindings . invalidate ( annotationClass ) ; } | removes all data for an annotation class . This should be called after an annotation has been modified through the SPI |
26,584 | public static < K , V > Map < K , V > immutableMapView ( Map < K , V > map ) { if ( map instanceof ImmutableMap < ? , ? > ) { return map ; } return Collections . unmodifiableMap ( map ) ; } | Returns an immutable view of a given map . |
26,585 | 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 ( metho... | Validates the producer method |
26,586 | ProtectionDomain getProtectionDomainForProxy ( ProtectionDomain domain ) { if ( domain . getCodeSource ( ) == null ) { return create ( domain ) ; } ProtectionDomain proxyProtectionDomain = proxyProtectionDomains . get ( domain . getCodeSource ( ) ) ; if ( proxyProtectionDomain == null ) { proxyProtectionDomain = create... | Gets an enhanced protection domain for a proxy based on the given protection domain . |
26,587 | 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 Annot... | we can t call this method of cause it won t compile on JDK7 |
26,588 | protected void init ( EnhancedAnnotation < T > annotatedAnnotation ) { initType ( annotatedAnnotation ) ; initValid ( annotatedAnnotation ) ; check ( annotatedAnnotation ) ; } | Initializes the type and validates it |
26,589 | protected void initValid ( EnhancedAnnotation < T > annotatedAnnotation ) { this . valid = false ; for ( Class < ? extends Annotation > annotationType : getMetaAnnotationTypes ( ) ) { if ( annotatedAnnotation . isAnnotationPresent ( annotationType ) ) { this . valid = true ; } } } | Validates the data for correct annotation |
26,590 | private void installFastProcessAnnotatedTypeResolver ( ServiceRegistry services ) { ClassFileServices classFileServices = services . get ( ClassFileServices . class ) ; if ( classFileServices != null ) { final GlobalObserverNotifierService observers = services . get ( GlobalObserverNotifierService . class ) ; try { fin... | needs to be resolved once extension beans are deployed |
26,591 | public String load ( ) { this . paginator = new Paginator ( ) ; this . codes = null ; this . codes = codeFragmentManager . searchCodeFragments ( this . codeFragmentPrototype , this . page , this . paginator ) ; return "history" ; } | Do the search called as a page action |
26,592 | public < T > InternalEjbDescriptor < T > get ( String beanName ) { return cast ( ejbByName . get ( beanName ) ) ; } | Gets an iterator to the EJB descriptors for an EJB implementation class |
26,593 | private < T > void add ( EjbDescriptor < T > ejbDescriptor ) { InternalEjbDescriptor < T > internalEjbDescriptor = InternalEjbDescriptor . of ( ejbDescriptor ) ; ejbByName . put ( ejbDescriptor . getEjbName ( ) , internalEjbDescriptor ) ; ejbByClass . put ( ejbDescriptor . getBeanClass ( ) , internalEjbDescriptor . get... | Adds an EJB descriptor to the maps |
26,594 | private void fireEventForNonWebModules ( Type eventType , Object event , Annotation ... qualifiers ) { try { BeanDeploymentModules modules = deploymentManager . getServices ( ) . get ( BeanDeploymentModules . class ) ; if ( modules != null ) { for ( BeanDeploymentModule module : modules ) { if ( ! module . isWebModule ... | Fires given event for non - web modules . Used for |
26,595 | public static void initialize ( BeanManagerImpl deploymentManager , ServiceRegistry deploymentServices ) { Container instance = new Container ( RegistrySingletonProvider . STATIC_INSTANCE , deploymentManager , deploymentServices ) ; Container . instance . set ( RegistrySingletonProvider . STATIC_INSTANCE , instance ) ;... | Initialize the container for the current application deployment |
26,596 | public void cleanup ( ) { managers . clear ( ) ; for ( BeanManagerImpl beanManager : beanDeploymentArchives . values ( ) ) { beanManager . cleanup ( ) ; } beanDeploymentArchives . clear ( ) ; deploymentServices . cleanup ( ) ; deploymentManager . cleanup ( ) ; instance . clear ( contextId ) ; } | Cause the container to be cleaned up including all registered bean managers and all deployment services |
26,597 | public void putBeanDeployments ( BeanDeploymentArchiveMapping bdaMapping ) { for ( Entry < BeanDeploymentArchive , BeanManagerImpl > entry : bdaMapping . getBdaToBeanManagerMap ( ) . entrySet ( ) ) { beanDeploymentArchives . put ( entry . getKey ( ) , entry . getValue ( ) ) ; addBeanManager ( entry . getValue ( ) ) ; }... | Add sub - deployment units to the container |
26,598 | private < Y > void checkObserverMethod ( EnhancedAnnotatedMethod < T , Y > annotated ) { List < EnhancedAnnotatedParameter < ? , Y > > eventObjects = annotated . getEnhancedParameters ( Observes . class ) ; eventObjects . addAll ( annotated . getEnhancedParameters ( ObservesAsync . class ) ) ; if ( this . reception . e... | Performs validation of the observer method for compliance with the specifications . |
26,599 | 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 != Reception . IF_EXISTS ) { creationalContext = beanManager . createCr... | Invokes the observer method immediately passing the event . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.