Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<properties>
<java.version>25</java.version>
<jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
<maven-checkstyle-plugin.version>3.5.0</maven-checkstyle-plugin.version>
<checkstyle.version>10.6.0</checkstyle.version>
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<checkstyle.version>12.1.2</checkstyle.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<jjwt.version>0.12.6</jjwt.version>
<okhttp.version>5.3.2</okhttp.version>
Expand Down Expand Up @@ -91,6 +91,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -136,7 +143,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -188,7 +195,7 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.9.0</version>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DeleteActivityProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(DeleteActivityProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DeleteAgentProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(DeleteAgentProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DeleteStateApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(DeleteStateApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DeleteStatesApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(DeleteStatesApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class GetAboutApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetAboutApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GetActivityProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetActivityProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class GetActivityProfilesApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetActivityProfilesApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class GetActivityApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetActivityApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GetAgentProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetAgentProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class GetAgentProfilesApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetAgentProfilesApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class GetAgentsApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetAgentsApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GetMoreStatementsApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetMoreStatementsApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GetStateApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetStateApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class GetStatementIteratorApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetStatementIteratorApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class GetStatementWithAttachmentApplication implements CommandLineRunner
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetStatementWithAttachmentApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class GetStatementApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetStatementApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GetStatementsApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetStatementsApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class GetStatesApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetStatesApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class GetVoidedStatementApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(GetVoidedStatementApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PostActivityProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostActivityProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PostAgentProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostAgentProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class PostSignedStatementApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostSignedStatementApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PostStateApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostStateApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class PostStatementWithAttachmentApplication implements CommandLineRunner
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostStatementWithAttachmentApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class PostStatementApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostStatementApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class PostStatementsApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PostStatementsApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PutActivityProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PutActivityProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PutAgentProfileApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PutAgentProfileApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class PutStateApplication implements CommandLineRunner {
/** Default xAPI client. Properties are picked automatically from application.properties. */
@Autowired private XapiClient client;

/** Main method to start the application. */
public static void main(String[] args) {
SpringApplication.run(PutStateApplication.class, args).close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,16 @@ private List<Object> getParts(Object object) {

final var list = new ArrayList<>();

Stream<Attachment> attachments;
if (object instanceof final Statement statement) {
attachments = getRealAttachments(statement);
} else if (object instanceof final List<?> statements
&& !statements.isEmpty()
&& statements.get(0) instanceof Statement) {
attachments = ((List<Statement>) statements).stream().flatMap(this::getRealAttachments);
} else {
final Stream<Attachment> attachments =
switch (object) {
case Statement statement -> getRealAttachments(statement);
case List<?> statements
when !statements.isEmpty() && statements.get(0) instanceof Statement ->
((List<Statement>) statements).stream().flatMap(this::getRealAttachments);
default -> null;
};

if (attachments == null) {
// The object is not a statement or list of statements
return list;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void accept(Builder builder) {
mockWebServer = new MockWebServer();
try {
mockWebServer.start();
} catch (final IOException e) {
} catch (final IOException e) { // Named parameter required by Google Java Style
// Ignore - test will fail if server doesn't start
}
builder.baseUrl(mockWebServer.url("").toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void accept(Builder builder) {
mockWebServer = new MockWebServer();
try {
mockWebServer.start();
} catch (final IOException e) {
} catch (final IOException e) { // Named parameter required by Google Java Style
// Ignore - test will fail if server doesn't start
}
builder.baseUrl(mockWebServer.url("").toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class LocaleSerializer extends StdSerializer<Locale> {

private static final long serialVersionUID = 7182941951585541965L;

/** Default constructor. */
public LocaleSerializer() {
super(Locale.class);
}
Expand All @@ -40,6 +41,7 @@ public static class LocaleKeySerializer extends StdSerializer<Locale> {

private static final long serialVersionUID = 7182941951585541965L;

/** Default constructor. */
public LocaleKeySerializer() {
super(Locale.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static Locale validateLocale(String localeString, DeserializationContext deseria
// test validity of language and country codes (throws exception)
locale.getISO3Language();
locale.getISO3Country();
} catch (final MissingResourceException e) {
} catch (final MissingResourceException e) { // Named parameter required by Google Java Style
locale = null;
}
// test the validity of the whole key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ public interface ValidatorDisabler {
public static final ValidatorDisabler DEFAULT_DISABLER = v -> true;
public static final ValidatorDisabler DEFAULT_ENABLER = v -> false;

/**
* Checks whether the given validator is disabled.
*
* @param validator the validator to check
* @return true if the validator is disabled, false otherwise
*/
public boolean isDisabled(DisableableValidator<?, ?> validator);
}