Class GlueLoadingAdvisor

java.lang.Object
io.cucumber.java.GlueLoadingAdvisor
All Implemented Interfaces:
AutoCloseable

final class GlueLoadingAdvisor extends Object implements AutoCloseable
This class gives advices to the developer to improve the glue loading performance.
  • Field Details

    • log

      private static final Logger log
    • containerClasses

      private final Set<Class<?>> containerClasses
    • glueClasses

      private final Set<Class<?>> glueClasses
    • request

      private final GlueDiscoveryRequest request
    • clock

      private final Clock clock
    • glueLoadingStart

      private final Instant glueLoadingStart
    • loggedOnce

      static final AtomicBoolean loggedOnce
  • Constructor Details

  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • logGlueLoadingSuggestions

      private void logGlueLoadingSuggestions()
      Logs suggestions to improve the glue loading performance if the scanning of glue package takes more time than the threshold defined by the "cucumber.glue.hint.threshold" property. Enabled by "cucumber.glue.hint.enabled" property. The suggestions are ordered by decreasing efficiency.
    • addSuggestionCucumberGlue

      private static void addSuggestionCucumberGlue(List<URI> gluePaths, List<String> suggestions)
    • addSuggestionRemoveClassWithoutGlueFromGluePackage

      private void addSuggestionRemoveClassWithoutGlueFromGluePackage(List<String> suggestions)
    • addSuggestionChangePublicStaticInnerClassesToPrivateClasses

      private void addSuggestionChangePublicStaticInnerClassesToPrivateClasses(List<String> suggestions)
    • addSuggestionRemoveNonPublicClassFromGluePackage

      private void addSuggestionRemoveNonPublicClassFromGluePackage(List<String> suggestions)
    • addGlueClass

      void addGlueClass(Class<?> glueClass)
      Adds a class coming from the glue package. It may or may not contain glue items (step definitions, hooks, injectors).
      Parameters:
      glueClass - the class coming from the glue package
    • addContainerClass

      void addContainerClass(Class<?> containerClass)
      Adds a class containing glue items (step definitions, hooks, injectors).
      Parameters:
      containerClass - the class that have been added to the container