Skip to content

Commit

Permalink
Removing private for @Inject
Browse files Browse the repository at this point in the history
  • Loading branch information
cuioss committed Sep 7, 2023
1 parent 211b588 commit a4066c4
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class PortalTracing {
private static final CuiLogger log = new CuiLogger(PortalTracing.class);

@Inject
private Instance<SpanHandler> spanHandlers;
Instance<SpanHandler> spanHandlers;

/**
* @return true, if distributed tracing is enabled. defaults to
Expand Down Expand Up @@ -247,7 +247,7 @@ public static String getServiceName(final String url) {
serviceName = uri.getHost();

final var path = uri.getPath();
if (path.length() > 0 && '/' == path.charAt(0)) {
if ((path.length() > 0) && ('/' == path.charAt(0))) {
// the path contains a leading slash, but maybe that's it?!
final var endpointCandidate = path.substring(1).split("/")[0];
if (!isEmpty(endpointCandidate)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public class PortalTracingServletFilter implements Filter {
private static final CuiLogger log = new CuiLogger(PortalTracingServletFilter.class);

@Inject
private Provider<Tracing> tracing;
Provider<Tracing> tracing;

@Inject
@ConfigProperty(name = PORTAL_TRACING_SERVLET_ENABLED)
private Provider<Boolean> servletTracingEnabled;
Provider<Boolean> servletTracingEnabled;

private Filter filter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ResourceBundleRegistryImpl implements ResourceBundleRegistry {

@Inject
@PortalResourceBundleLocator
private Instance<ResourceBundleLocator> locatorList;
Instance<ResourceBundleLocator> locatorList;

/**
* The computed / resolved names in the correct order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class PortalSystemPropertiesConfigurator implements ApplicationInitialize

@Inject
@ConfigAsFilteredMap(startsWith = PORTAL_SYSTEM_PROPERTY_PREFIX, stripPrefix = true)
private Provider<Map<String, String>> systemProperties;
Provider<Map<String, String>> systemProperties;

@Override
public void initialize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class PortalConfigProducer {

@Inject
@ConfigProperty(name = PORTAL_METRICS_ENABLED, defaultValue = "false")
private Provider<Boolean> portalMetricsEnabled;
Provider<Boolean> portalMetricsEnabled;

/**
* @param injectionPoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class PortalProjectStageImpl implements PortalProjectStage, Serializable

@Inject
@ConfigProperty(name = PortalConfigurationKeys.PORTAL_STAGE)
private Provider<String> portalStageConfigurationProvider;
Provider<String> portalStageConfigurationProvider;

/**
* Initializes the bean. See class documentation for expected result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,20 @@ public class ConfigChangeObserver implements ApplicationInitializer {

@Inject
@PortalFileWatcherService
private Instance<FileWatcherService> fileWatcherServices;
Instance<FileWatcherService> fileWatcherServices;

@Inject
private Instance<FileConfigurationSource> fileConfigurationSources;
Instance<FileConfigurationSource> fileConfigurationSources;

/** Fired, if the configuration of the changed file has changed */
@Inject
@ConfigurationSourceChangeEvent
private Event<Map<String, String>> sourceChangeEvent;
Event<Map<String, String>> sourceChangeEvent;

/** To be fired if any of the registered files has changed */
@Inject
@PortalConfigurationChangeEvent
private Event<Map<String, String>> configChangeEvent;
Event<Map<String, String>> configChangeEvent;

@Override
public void initialize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Event;
Expand Down Expand Up @@ -75,7 +74,7 @@ public class FileWatcherServiceImpl implements FileWatcherService, ApplicationIn

@Inject
@ConfigProperty(name = SCHEDULER_FILE_SCAN_ENABLED)
private Provider<Boolean> enabledProvider;
Provider<Boolean> enabledProvider;

private WatchService watcherService;

Expand All @@ -95,7 +94,7 @@ public class FileWatcherServiceImpl implements FileWatcherService, ApplicationIn

@Inject
@FileChangedEvent
private Event<Path> fileChangeEvent;
Event<Path> fileChangeEvent;

/**
* Initializes the watcher depending on the configuration of
Expand Down Expand Up @@ -200,8 +199,7 @@ public void unregister(Path... paths) {

@Override
public List<Path> getRegisteredPaths() {
List<Path> paths = registeredPaths.values().stream().map(AbstractFileDescriptor::getPath)
.toList();
List<Path> paths = registeredPaths.values().stream().map(AbstractFileDescriptor::getPath).toList();
log.trace("getRegisteredPaths callled, returning {}", paths);
return paths;
}
Expand Down Expand Up @@ -253,8 +251,7 @@ private void handleChangedWatchKey(WatchKey watchKey) {
return;
}
if (log.isTraceEnabled()) {
log.trace("Handling WatchKey-Events {}",
events.stream().map(w -> w.context() + "-" + w.kind()).toList());
log.trace("Handling WatchKey-Events {}", events.stream().map(w -> w.context() + "-" + w.kind()).toList());
}
List<AbstractFileDescriptor> changed = registeredPaths.values().stream()
.filter(AbstractFileDescriptor::isUpdated).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ public class ServletLifecycleListener implements ServletContextListener {

@Inject
@PortalInitializer
private Instance<ApplicationInitializer> applicationInitializers;
Instance<ApplicationInitializer> applicationInitializers;

@Produces
@Dependent
@Named
@CuiContextPath
private String contextPath = "portal";
String contextPath = "portal";

@Override
public void contextInitialized(ServletContextEvent sce) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public abstract class AbstractPortalServlet extends HttpServlet {

@Inject
@PortalUser
private Provider<AuthenticatedUserInfo> userInfoProvider;
Provider<AuthenticatedUserInfo> userInfoProvider;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ExternalHostnameProducer {
private static final CuiLogger log = new CuiLogger(ExternalHostnameProducer.class);

@Inject
private Provider<HttpServletRequest> httpServletRequest;
Provider<HttpServletRequest> httpServletRequest;

@Produces
@Dependent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public class PortalUserProducer implements Serializable {
@SuppressWarnings("cdi-ambiguous-dependency")
@Inject
@PortalAuthenticationFacade
private AuthenticationFacade authenticationFacade;
AuthenticationFacade authenticationFacade;

@Inject
private Provider<HttpServletRequest> servletRequestProvider;
Provider<HttpServletRequest> servletRequestProvider;

/**
* Initializes the produces by fetching user from facade
Expand Down

0 comments on commit a4066c4

Please sign in to comment.