@Test public void testValidateCacheSize() { assertEquals(LRUBuilderCache.validateCacheSize("10"), "10"); assertEquals(LRUBuilderCache.validateCacheSize("-10"), LRUBuilderCache.DEFAULT_BUILDER_CACHE_SIZE); assertEquals(LRUBuilderCache.validateCacheSize(""), LRUBuilderCache.DEFAULT_BUILDER_CACHE_SIZE); assertEquals(LRUBuilderCache.validateCacheSize("ab"), LRUBuilderCache.DEFAULT_BUILDER_CACHE_SIZE); assertEquals(LRUBuilderCache.validateCacheSize(null), LRUBuilderCache.DEFAULT_BUILDER_CACHE_SIZE); }
protected static String validateCacheSize(final String value) { if (value == null || value.length() == 0 || !value.matches("^[0-9]*$")) { logger.error("Illeagal Argument : Property {} should be a positive integer", BUILDER_CACHE_SIZE); return DEFAULT_BUILDER_CACHE_SIZE; } return value; }
LRUBuilderCache extends LRUCache<Module, Builder> { protected static String validateCacheSize(final String value) { if (value == null || value.length() == 0 || !value.matches("^[0-9]*$")) { logger.error("Illeagal Argument : Property {} should be a positive integer", BUILDER_CACHE_SIZE); return DEFAULT_BUILDER_CACHE_SIZE; } return value; } }
LRUBuilderCache extends LRUCache<Module, Builder> { protected static String validateCacheSize(final String value) { if (value == null || value.length() == 0 || !value.matches("^[0-9]*$")) { logger.error("Illeagal Argument : Property {} should be a positive integer", BUILDER_CACHE_SIZE); return DEFAULT_BUILDER_CACHE_SIZE; } return value; } LRUBuilderCache(); @Inject  LRUBuilderCache(final @Named("ioStrategy") IOService ioService,
                           final KieModuleService moduleService,
                           final ProjectImportsService importsService,
                           final @Any Instance<BuildValidationHelper> buildValidationHelperBeans,
                           final @Named("LRUModuleDependenciesClassLoaderCache") LRUModuleDependenciesClassLoaderCache dependenciesClassLoaderCache,
                           final @Named("LRUPomModelCache") LRUPomModelCache pomModelCache,
                           final PackageNameWhiteListService packageNameWhiteListService,
                           final @JavaSourceFilter Instance<Predicate<String>> classFilterBeans); }
LRUBuilderCache extends LRUCache<Module, Builder> { protected static String validateCacheSize(final String value) { if (value == null || value.length() == 0 || !value.matches("^[0-9]*$")) { logger.error("Illeagal Argument : Property {} should be a positive integer", BUILDER_CACHE_SIZE); return DEFAULT_BUILDER_CACHE_SIZE; } return value; } LRUBuilderCache(); @Inject  LRUBuilderCache(final @Named("ioStrategy") IOService ioService,
                           final KieModuleService moduleService,
                           final ProjectImportsService importsService,
                           final @Any Instance<BuildValidationHelper> buildValidationHelperBeans,
                           final @Named("LRUModuleDependenciesClassLoaderCache") LRUModuleDependenciesClassLoaderCache dependenciesClassLoaderCache,
                           final @Named("LRUPomModelCache") LRUPomModelCache pomModelCache,
                           final PackageNameWhiteListService packageNameWhiteListService,
                           final @JavaSourceFilter Instance<Predicate<String>> classFilterBeans); @PostConstruct void loadInstances(); @PreDestroy void destroyInstances(); void invalidateProjectCache(@Observes final InvalidateDMOModuleCacheEvent event); Builder assertBuilder(POM pom); Builder assertBuilder(final Module module); Builder getBuilder(final Module module); }
LRUBuilderCache extends LRUCache<Module, Builder> { protected static String validateCacheSize(final String value) { if (value == null || value.length() == 0 || !value.matches("^[0-9]*$")) { logger.error("Illeagal Argument : Property {} should be a positive integer", BUILDER_CACHE_SIZE); return DEFAULT_BUILDER_CACHE_SIZE; } return value; } LRUBuilderCache(); @Inject  LRUBuilderCache(final @Named("ioStrategy") IOService ioService,
                           final KieModuleService moduleService,
                           final ProjectImportsService importsService,
                           final @Any Instance<BuildValidationHelper> buildValidationHelperBeans,
                           final @Named("LRUModuleDependenciesClassLoaderCache") LRUModuleDependenciesClassLoaderCache dependenciesClassLoaderCache,
                           final @Named("LRUPomModelCache") LRUPomModelCache pomModelCache,
                           final PackageNameWhiteListService packageNameWhiteListService,
                           final @JavaSourceFilter Instance<Predicate<String>> classFilterBeans); @PostConstruct void loadInstances(); @PreDestroy void destroyInstances(); void invalidateProjectCache(@Observes final InvalidateDMOModuleCacheEvent event); Builder assertBuilder(POM pom); Builder assertBuilder(final Module module); Builder getBuilder(final Module module);  }