Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,583 for constructors (0.22 sec)

  1. platforms/core-configuration/model-core/src/main/java/org/gradle/internal/instantiation/generator/ParamsMatchingConstructorSelector.java

            if (constructors.size() == 1) {
                return Cast.uncheckedCast(constructors.get(0));
            }
    
            ClassGenerator.GeneratedConstructor<?> match = null;
            // NOTE: this relies on the constructors being in a predictable order
            // sorted by the number of parameters the constructor requires
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 09:51:04 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  2. platforms/core-configuration/model-core/src/main/java/org/gradle/internal/instantiation/generator/InjectUtil.java

            if (constructors.size() == 1) {
                ClassGenerator.GeneratedConstructor<T> constructor = constructors.get(0);
                if (constructor.getParameterTypes().length == 0 && isPublicOrPackageScoped(type.getGeneratedClass(), constructor)) {
                    return constructor;
                }
                if (constructor.getAnnotation(Inject.class) != null) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 09:51:04 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  3. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/reflect/DirectInstantiatorCacheTest.groovy

        @Shared
        def cache = new DirectInstantiator.ConstructorCache()
    
        @Unroll("constructor cache returns the same constructors as 'getConstructors' for #clazz")
        def "constructor cache returns the same constructors as 'getConstructors'"() {
            given:
            def constructor = null
            int i = 0
            while (!constructor && ++i<50) {
                // need a loop because IBM JDK is much more proactive in cleaning weak references
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  4. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/service/InjectUtil.java

            final Constructor<?>[] constructors = type.getDeclaredConstructors();
            if (constructors.length == 1) {
                Constructor<?> constructor = constructors[0];
                if (isPublicOrPackageScoped(constructor)) {
                    // If there is a single constructor, and that constructor is public or package private we select it.
                    return constructor;
                }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 4K bytes
    - Viewed (0)
  5. platforms/core-runtime/native/src/test/groovy/org/gradle/internal/nativeintegration/services/NativeServicesInitializationTest.groovy

            e.message == "Cannot get an instance of NativeServices without first calling initialize()."
        }
    
        def "no public constructors on NativeServices" () {
            Constructor[] constructors = NativeServices.getConstructors()
    
            expect:
            constructors.size() == 0
        }
    
        private static URL jar(Class clazz) {
            clazz.getProtectionDomain().getCodeSource().getLocation()
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri May 17 08:51:56 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  6. platforms/core-configuration/model-core/src/test/groovy/org/gradle/internal/instantiation/generator/IdentityClassGenerator.java

                @Override
                public List<GeneratedConstructor<T>> getConstructors() {
                    List<GeneratedConstructor<T>> constructors = new ArrayList<GeneratedConstructor<T>>();
                    for (final Constructor<?> constructor : type.getDeclaredConstructors()) {
                        constructors.add(new GeneratedConstructor<T>() {
                            @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 09:51:04 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  7. platforms/core-configuration/model-core/src/test/groovy/org/gradle/internal/instantiation/generator/AbstractClassGeneratorSpec.groovy

        }
    
        def "order of constructors is based on number of parameters"() {
            // We rely on processing the constructors in a predictable order (fewest parameters -> most)
            def constructors = generator.generate(ManyConstructors).getConstructors()
            expect:
            int count = 0
            constructors.each { constructor ->
                assert count <= constructor.parameterTypes.length
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 09:51:04 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  8. platforms/core-configuration/model-core/src/test/groovy/org/gradle/internal/instantiation/generator/DependencyInjectingInstantiatorTest.groovy

            when:
            instantiator.newInstance(HasMixedConstructors, new StringBuilder("param"))
    
            then:
            ObjectInstantiationException e = thrown()
            e.cause.message == "Class DependencyInjectingInstantiatorTest.HasMixedConstructors has no constructor that is annotated with @Inject."
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Mar 19 04:41:06 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  9. platforms/core-configuration/model-core/src/test/groovy/org/gradle/internal/instantiation/generator/DependencyInjectionUsingLenientConstructorSelectorTest.groovy

      1. candidate: DependencyInjectionUsingLenientConstructorSelectorTest.HasConstructors(String, Number)
      2. best match: DependencyInjectionUsingLenientConstructorSelectorTest.HasConstructors(String, boolean)"""
        }
    
        def "uses exact match constructor when constructors could be ambiguous with multiple parameters"() {
            when:
            // HasSeveralParameters has 3 constructors
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Sep 28 09:51:04 UTC 2023
    - 8K bytes
    - Viewed (0)
  10. maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java

            }
    
            if (constructors.isEmpty()) {
                throw failedImplicitBinding(key, "inject annotation on interface");
            }
            if (constructors.size() > 1) {
                throw failedImplicitBinding(key, "inject annotation on class with multiple constructors");
            }
            Constructor<T> declaredConstructor =
                    (Constructor<T>) constructors.iterator().next();
    
    Registered: Wed Jun 12 09:55:16 UTC 2024
    - Last Modified: Fri Feb 09 17:13:31 UTC 2024
    - 16K bytes
    - Viewed (0)
Back to top