test_class.declarator: compilerFacade = new JavaCompilerFacade(
              JavaCompilerBeanPropertyReaderFactory.class.getClassLoader())
test_class.modifier: private final
test_class.original_string: private final JavaCompilerFacade compilerFacade = new JavaCompilerFacade(
              JavaCompilerBeanPropertyReaderFactory.class.getClassLoader());
test_class.type: JavaCompilerFacade
test_class.var_name: compilerFacade
test_class.declarator: reflections = new DefaultReflections()
test_class.modifier: private final
test_class.original_string: private final Reflections reflections = new DefaultReflections();
test_class.type: Reflections
test_class.var_name: reflections
test_class.declarator: fallback = new ReflectionInstanceSupplierFactory(reflections)
test_class.modifier: private
test_class.original_string: private InstanceSupplierFactory fallback = new ReflectionInstanceSupplierFactory(reflections);
test_class.type: InstanceSupplierFactory
test_class.var_name: fallback
test_class.file: artemis-core/src/test/java/org/jnosql/artemis/reflection/JavaCompilerInstanceSupplierFactoryTest.java
test_class.identifier: JavaCompilerInstanceSupplierFactoryTest
test_case.body: @Test
      public void shouldCreateInstanceSupplier() {
          JavaCompilerInstanceSupplierFactory factory = new JavaCompilerInstanceSupplierFactory(compilerFacade, reflections, fallback);
          InstanceSupplier instanceSupplier = factory.apply(Foo.class.getConstructors()[0]);
          Assertions.assertNotNull(instanceSupplier);
          Object value = instanceSupplier.get();
          Assertions.assertTrue(value instanceof Foo);
      }
test_case.class_method_signature: JavaCompilerInstanceSupplierFactoryTest.shouldCreateInstanceSupplier()
test_case.full_signature: @Test public void shouldCreateInstanceSupplier()
test_case.identifier: shouldCreateInstanceSupplier
test_case.invocations: apply getConstructors assertNotNull get assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldCreateInstanceSupplier()
focal_class.declarator: LOGGER = Logger.getLogger(JavaCompilerInstanceSupplierFactory.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(JavaCompilerInstanceSupplierFactory.class.getName());
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: TEMPLATE_FILE = "InstanceSupplier.template"
focal_class.modifier: private static final
focal_class.original_string: private static final String TEMPLATE_FILE = "InstanceSupplier.template";
focal_class.type: String
focal_class.var_name: TEMPLATE_FILE
focal_class.declarator: TEMPLATE = TemplateReader.INSTANCE.apply(TEMPLATE_FILE)
focal_class.modifier: private static final
focal_class.original_string: private static final String TEMPLATE = TemplateReader.INSTANCE.apply(TEMPLATE_FILE);
focal_class.type: String
focal_class.var_name: TEMPLATE
focal_class.declarator: compilerFacade
focal_class.modifier: private final
focal_class.original_string: private final JavaCompilerFacade compilerFacade;
focal_class.type: JavaCompilerFacade
focal_class.var_name: compilerFacade
focal_class.declarator: reflections
focal_class.modifier: private final
focal_class.original_string: private final Reflections reflections;
focal_class.type: Reflections
focal_class.var_name: reflections
focal_class.declarator: fallback
focal_class.modifier: private final
focal_class.original_string: private final InstanceSupplierFactory fallback;
focal_class.type: InstanceSupplierFactory
focal_class.var_name: fallback
focal_class.file: artemis-core/src/main/java/org/jnosql/artemis/reflection/JavaCompilerInstanceSupplierFactory.java
focal_class.identifier: JavaCompilerInstanceSupplierFactory
focal_class.interfaces: implements InstanceSupplierFactory
focal_class.class_method_signature: JavaCompilerInstanceSupplierFactory.JavaCompilerInstanceSupplierFactory(JavaCompilerFacade compilerFacade, Reflections reflections, InstanceSupplierFactory fallback)
focal_class.full_signature:   JavaCompilerInstanceSupplierFactory(JavaCompilerFacade compilerFacade, Reflections reflections, InstanceSupplierFactory fallback)
focal_class.identifier: JavaCompilerInstanceSupplierFactory
focal_class.parameters: (JavaCompilerFacade compilerFacade, Reflections reflections, InstanceSupplierFactory fallback)
focal_class.signature:  JavaCompilerInstanceSupplierFactory(JavaCompilerFacade compilerFacade, Reflections reflections, InstanceSupplierFactory fallback)
focal_class.class_method_signature: JavaCompilerInstanceSupplierFactory.apply(Constructor<?> constructor)
focal_class.full_signature: @Override public InstanceSupplier apply(Constructor<?> constructor)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (Constructor<?> constructor)
focal_class.return: InstanceSupplier
focal_class.signature: InstanceSupplier apply(Constructor<?> constructor)
focal_method.body: @Override
      public InstanceSupplier apply(Constructor<?> constructor) {
          Class<?> declaringClass = constructor.getDeclaringClass();
          if (Modifier.isPublic(constructor.getModifiers())) {
              String packageName = declaringClass.getPackage().getName();
              String simpleName = declaringClass.getSimpleName() + "$InstanceSupplier";
              String newInstance = declaringClass.getName();
              String name = declaringClass.getName() + "$InstanceSupplier";
              String javaSource = StringFormatter.INSTANCE.format(TEMPLATE, packageName, simpleName, newInstance);
              InstanceJavaSource source = new InstanceJavaSource(name, simpleName, javaSource);
              Class<? extends InstanceSupplier> supplier = compilerFacade.apply(source);
              return reflections.newInstance(supplier);
          }
  
          LOGGER.fine(String.format("The constructor to the class %s is not public, using fallback with Reflectioin",
                  declaringClass.getName()));
          return fallback.apply(constructor);
      }
focal_method.class_method_signature: JavaCompilerInstanceSupplierFactory.apply(Constructor<?> constructor)
focal_method.full_signature: @Override public InstanceSupplier apply(Constructor<?> constructor)
focal_method.identifier: apply
focal_method.invocations: getDeclaringClass isPublic getModifiers getName getPackage getSimpleName getName getName format apply newInstance fine format getName apply
focal_method.modifiers: @Override public
focal_method.parameters: (Constructor<?> constructor)
focal_method.return: InstanceSupplier
focal_method.signature: InstanceSupplier apply(Constructor<?> constructor)