Skip to content

Commit

Permalink
(chores) core: use final when possible
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio R. Piske <[email protected]>
  • Loading branch information
orpiske committed Jul 23, 2023
1 parent 2dc1783 commit 05b727d
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public void setType(Class<E> type) {
}

private class PropertyInjector extends FlexibleAggregationStrategyInjector {
private String propertyName;
private final String propertyName;

PropertyInjector(Class<E> type, String propertyName) {
super(type);
Expand Down Expand Up @@ -376,7 +376,7 @@ public void setValueAsCollection(Exchange exchange, Collection<E> obj) {
}

private class HeaderInjector extends FlexibleAggregationStrategyInjector {
private String headerName;
private final String headerName;

HeaderInjector(Class<E> type, String headerName) {
super(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void execute(Runnable command) {
private Processor errorHandler;
private String id;
private String routeId;
private Collection<Processor> processors;
private final Collection<Processor> processors;
private final AggregationStrategy aggregationStrategy;
private final boolean parallelProcessing;
private boolean synchronous;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class SendProcessor extends AsyncProcessorSupport implements Traceable, E
protected final ExchangePattern pattern;
protected ProducerCache producerCache;
protected AsyncProducer producer;
protected Endpoint destination;
protected final Endpoint destination;
protected ExchangePattern destinationExchangePattern;
protected String id;
protected String routeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private enum State {
private boolean asyncDelayed;
private boolean callerRunsWhenRejected = true;
private Expression correlationExpression;
private Map<String, ThrottlingState> states = new ConcurrentHashMap<>();
private final Map<String, ThrottlingState> states = new ConcurrentHashMap<>();

public Throttler(final CamelContext camelContext, final Expression maxRequestsPerPeriodExpression,
final long timePeriodMillis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void setStatisticsEnabled(boolean statisticsEnabled) {
private Expression completionSizeExpression;
private boolean completionFromBatchConsumer;
private boolean completionOnNewCorrelationGroup;
private AtomicInteger batchConsumerCounter = new AtomicInteger();
private final AtomicInteger batchConsumerCounter = new AtomicInteger();
private boolean discardOnCompletionTimeout;
private boolean discardOnAggregationFailure;
private boolean forceCompletionOnStop;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
*/
public abstract class SagaProcessor extends DelegateAsyncProcessor implements Traceable, IdAware, RouteIdAware {

protected CamelSagaService sagaService;
protected final CamelSagaService sagaService;

protected CamelSagaStep step;
protected final CamelSagaStep step;

protected SagaCompletionMode completionMode;
protected final SagaCompletionMode completionMode;

private String id;
private String routeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
private static final Logger LOG = LoggerFactory.getLogger(AbstractCamelContextFactoryBean.class);

@XmlTransient
private List<RoutesBuilder> builders = new ArrayList<>();
private final List<RoutesBuilder> builders = new ArrayList<>();
@XmlTransient
private ClassLoader contextClassLoaderOnStart;
private final ClassLoader contextClassLoaderOnStart;
@XmlTransient
private final AtomicBoolean routesSetupDone = new AtomicBoolean();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public abstract class BaseMainSupport extends BaseService {

protected final List<MainListener> listeners = new ArrayList<>();
protected volatile CamelContext camelContext;
protected MainConfigurationProperties mainConfigurationProperties = new MainConfigurationProperties();
protected OrderedLocationProperties wildcardProperties = new OrderedLocationProperties();
protected final MainConfigurationProperties mainConfigurationProperties = new MainConfigurationProperties();
protected final OrderedLocationProperties wildcardProperties = new OrderedLocationProperties();
protected RoutesCollector routesCollector = new DefaultRoutesCollector();
protected String propertyPlaceholderLocations;
protected String defaultPropertyPlaceholderLocation = MainConstants.DEFAULT_PROPERTY_PLACEHOLDER_LOCATION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ManagedProcessor extends ManagedPerformanceCounter implements Manag
private final ProcessorDefinition<?> definition;
private final String id;
private final int nodeLevel;
private String stepId;
private final String stepId;
private Route route;
private String sourceLocation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class FileUtil {
*/
private static final String USER_DIR_KEY = "user.dir";
private static final File USER_DIR = new File(System.getProperty(USER_DIR_KEY));
private static boolean windowsOs = initWindowsOs();
private static final boolean IS_WINDOWS = initWindowsOs();

private FileUtil() {
// Utils method
Expand Down Expand Up @@ -80,7 +80,7 @@ public static String normalizePath(String path) {
* Returns true, if the OS is windows
*/
public static boolean isWindows() {
return windowsOs;
return IS_WINDOWS;
}

public static File createTempFile(String prefix, String suffix, File parentDir) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ public class XmlStreamInfo {
String rootElementNamespace;

/** Prefix to namespace mapping. default prefix is available as empty String (and not as null) */
Map<String, String> namespaceMapping = new HashMap<>();
final Map<String, String> namespaceMapping = new HashMap<>();

/**
* Attributes of the root element. Keys are full qualified names of the attributes and each attribute may be
* available as two keys: {@code prefix:localName} or {@code {namespaceURI}localName}
*/
Map<String, String> attributes = new HashMap<>();
final Map<String, String> attributes = new HashMap<>();

/**
* Trimmed and unparsed lines starting with Camel-recognized modeline markers (now: {@code camel-k:}).
*/
List<String> modelines = new ArrayList<>();
final List<String> modelines = new ArrayList<>();

public boolean isValid() {
return problem == null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
*/
class XMLStreamReaderInputStream extends InputStream {
private static final int BUFFER_SIZE = 4096;
private XMLStreamReader reader;
private final XMLStreamReader reader;
private XMLStreamWriter writer;
private TrimmableByteArrayOutputStream chunk;
private byte[] buffer;
private String charset;
private final TrimmableByteArrayOutputStream chunk;
private final byte[] buffer;
private final String charset;
private int bpos;

XMLStreamReaderInputStream(XMLStreamReader reader, String charset, XMLOutputFactory outfactory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
*/
class XMLStreamReaderReader extends Reader {
private static final int BUFFER_SIZE = 4096;
private XMLStreamReader reader;
private final XMLStreamReader reader;
private XMLStreamWriter writer;
private TrimmableCharArrayWriter chunk;
private char[] buffer;
private final TrimmableCharArrayWriter chunk;
private final char[] buffer;
private int bpos;

XMLStreamReaderReader(XMLStreamReader reader, XMLOutputFactory outfactory) {
Expand Down

0 comments on commit 05b727d

Please sign in to comment.