Skip to content

Commit

Permalink
#164 : Maven - Bumped Lombok for JDK21
Browse files Browse the repository at this point in the history
* Tweaked maven compiler settings for JDK21.
* Fixed Javadoc earnings in exchange adapters.
  • Loading branch information
gazbert committed Apr 11, 2024
1 parent 7813d0c commit 873b6bf
Show file tree
Hide file tree
Showing 27 changed files with 137 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class ExchangeConfigImpl implements ExchangeConfig {
private NetworkConfig networkConfig;
private OtherConfig otherConfig;

/** Creates the Exchange Config impl. */
public ExchangeConfigImpl() {
// No extra init needed.
}

@Override
public String getExchangeName() {
return exchangeName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public final class StrategyConfigItems implements StrategyConfig {

private Map<String, String> items = new HashMap<>();

/** Creates the Strategy Config Items. */
public StrategyConfigItems() {
// No extra init needed.
}

@Override
public String getConfigItem(String key) {
return items.get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class TradingStrategiesBuilder {

private TradingStrategyFactory tradingStrategyFactory;

/** Creates the Trading Strategies Builder. */
public TradingStrategiesBuilder() {
// No extra init needed.
}

/**
* Sets the trading strategy factory.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
@Log4j2
public class ConfigurableComponentFactory {

/** Creates the Configurable Component Factory. */
public ConfigurableComponentFactory() {
// No extra init needed.
}

/**
* Loads and instantiates a given class and returns it.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class ExchangeConfig {

@Schema(
requiredMode = Schema.RequiredMode.REQUIRED,
requiredMode = Schema.RequiredMode.REQUIRED,
description =
"The Exchange name. It is used in log statements to display the Exchange's name."
+ " Value must be an alphanumeric string. Spaces are allowed.")
Expand Down Expand Up @@ -69,6 +69,11 @@ public class ExchangeConfig {
+ "any additional config, e.g. buy/sell fees.")
private Map<String, String> otherConfig;

/** Creates the Exchange config. */
public ExchangeConfig() {
// No extra init needed.
}

/**
* Returns the name.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ public final class BitfinexExchangeAdapter extends AbstractExchangeAdapter

private Gson gson;

/** Constructs the Exchange Adapter. */
public BitfinexExchangeAdapter() {
// No extra init.
}

@Override
public void init(ExchangeConfig config) {
log.info("About to initialise Bitfinex ExchangeConfig: " + config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public class BitstampExchangeAdapter extends AbstractExchangeAdapter implements

private Gson gson;

/** Constructs the Exchange Adapter. */
public BitstampExchangeAdapter() {
// No extra init.
}

@Override
public void init(ExchangeConfig config) {
log.info("About to initialise Bitstamp ExchangeConfig: " + config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public final class CoinbaseProExchangeAdapter extends AbstractExchangeAdapter

private Gson gson;

/** Constructs the Exchange Adapter. */
public CoinbaseProExchangeAdapter() {
// No extra init.
}

@Override
public void init(ExchangeConfig config) {
log.info("About to initialise COINBASE PRO ExchangeConfig: " + config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ public String getStringValue() {

private Gson gson;

/** Constructs the Exchange Adapter. */
public GeminiExchangeAdapter() {
// No extra init.
}

@Override
public void init(ExchangeConfig config) {
log.info("About to initialise Gemini ExchangeConfig: " + config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,13 @@ public final class KrakenExchangeAdapter extends AbstractExchangeAdapter

private Mac mac;
private boolean initializedMacAuthentication = false;

private Gson gson;

/** Constructs the Exchange Adapter. */
public KrakenExchangeAdapter() {
// No extra init.
}

@Override
public void init(ExchangeConfig config) {
log.info("About to initialise Kraken ExchangeConfig: " + config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public class TryModeExchangeAdapter extends AbstractExchangeAdapter implements E
private OpenOrder currentOpenOrder;
private boolean isOpenOrderCheckReentering;

/** Constructs the Exchange Adapter. */
public TryModeExchangeAdapter() {
// No extra init.
}

@Override
public void init(ExchangeConfig config) {
log.info("About to initialise try-mode adapter with the following exchange config: " + config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public class RestApiConfig {
@Min(1)
private int maxLogfileDownloadSize;

/** Creates the REST API config. */
public RestApiConfig() {
// No extra init needed.
}

/**
* Returns the max logfile size (in bytes) to be returned by the REST API.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
@Component
public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint {

/** Creates the JWT Authentication Entry Point. */
public JwtAuthenticationEntryPoint() {
// No extra init needed.
}

/**
* This is invoked when a user tries to access a secured REST resource without supplying any
* credentials in the HTTP Authorization header.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {

private JwtUtils jwtUtils;

/** Creates the JWT Authentication Filter. */
public JwtAuthenticationFilter() {
// No extra init needed.
}

@Override
protected void doFilterInternal(
HttpServletRequest request, HttpServletResponse response, FilterChain chain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class RestCorsConfig {
@Value("${restapi.cors.allowed_origin}")
private String allowedOrigin;

/** Creates the REST CORS config. */
public RestCorsConfig() {
// No extra init needed.
}

/**
* Creates the CORS configuration for the CorsFilter to use.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public class JwtUtils {
@Value("${bxbot.restapi.jwt.audience}")
private String audience;

/** Creates the JWT Utils. */
public JwtUtils() {
// No extra init needed.
}

/**
* For simple validation, it is sufficient to check the token integrity by just decrypting it with
* the signing key and making sure it has not expired. We don't have to call the database for an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public class Role {
@ManyToMany(mappedBy = "roles", fetch = FetchType.LAZY)
private List<User> users;

/** Creates the Role. */
public Role() {
// No extra init needed.
}

/**
* Returns the id.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public class User {
inverseJoinColumns = {@JoinColumn(name = "ROLE_ID", referencedColumnName = "ID")})
private List<Role> roles;

/** Creates the User. */
public User() {
// No extra init needed.
}

/**
* Returns the id.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@
termsOfService = "https://github.com/gazbert/bxbot"))
@SecurityRequirement(name = "Authorization")
public abstract class RestController {

/** Constructs the REST Controller. */
public RestController() {
// No extra init needed.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ public class ExampleScalpingStrategy implements TradingStrategy {
*/
private BigDecimal minimumPercentageGain;

/** Constructs the Example Scalping Strategy. */
public ExampleScalpingStrategy() {
// No extra init.
}

/**
* Initialises the Trading Strategy. Called once by the Trading Engine when the bot starts up;
* it's a bit like a servlet init() method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public class ConfigurationManager {

private static final String YAML_HEADER = "---" + System.getProperty("line.separator");

/** Creates the Configuration Manager. */
public ConfigurationManager() {
// No extra init needed.
}

/**
* Loads the config from the YAML file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class EmailAlertsType {

private EmailAlertsConfig emailAlerts;

/** Creates the Email Alerts type. */
public EmailAlertsType() {
// No extra init needed.
}

/**
* Returns the email alerts config.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class EngineType {

private EngineConfig engine;

/** Creates the Engine type. */
public EngineType() {
// No extra init needed.
}

/**
* Returns the engine config.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class ExchangeType {

private ExchangeConfig exchange;

/** Creates the Exchange type. */
public ExchangeType() {
// No extra init needed.
}

/**
* Returns the exchange config.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class MarketsType {

private List<MarketConfig> markets;

/** Creates the Market type. */
public MarketsType() {
// No extra init needed.
}

/**
* Returns the market configs.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class StrategiesType {

private List<StrategyConfig> strategies;

/** Creates the Strategies type. */
public StrategiesType() {
// No extra init needed.
}

/**
* Returns the Strategy configs.
*
Expand Down
9 changes: 6 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<version>1.18.32</version>
</dependency>

<!--
Expand Down Expand Up @@ -362,8 +362,11 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
<compilerArgs>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</plugin>

Expand Down

0 comments on commit 873b6bf

Please sign in to comment.