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
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xAPI Java Development",
"image": "mcr.microsoft.com/devcontainers/java:25",
"image": "mcr.microsoft.com/devcontainers/java:17",

"features": {
"ghcr.io/devcontainers/features/java:1": {
Expand All @@ -15,7 +15,7 @@
"java.jdt.ls.java.home": "/usr/lib/jvm/msopenjdk-current",
"java.configuration.runtimes": [
{
"name": "JavaSE-25",
"name": "JavaSE-17",
"path": "/usr/lib/jvm/msopenjdk-current"
}
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
java-version: '17'

# Initializes the CodeQL tools for scanning.
# Uses custom configuration file to exclude test directories from analysis.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up JDK 25
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: "25"
java-version: "17"
distribution: "temurin"
cache: maven

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ jobs:

echo "Tag $TAG_NAME does not exist. Proceeding with release."

- name: Set up JDK 25
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: "25"
java-version: "17"
distribution: "temurin"
cache: maven
cache-dependency-path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 25
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: "25"
java-version: "17"
distribution: "temurin"
cache: maven
cache-dependency-path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 25
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: "25"
java-version: "17"
distribution: "temurin"
cache: maven
cache-dependency-path: |
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participatin

### Prerequisites

xAPI Java requires **Java 25 or newer**.
xAPI Java requires **Java 17 or newer**.

#### Installing Java 25
#### Installing Java 17

We recommend using [SDKMAN!](https://sdkman.io/) to install and manage Java versions:

```bash
# Install SDKMAN (if not already installed)
curl -s "https://get.sdkman.io" | bash

# Install Java 25 (Temurin distribution recommended)
sdk install java 25.0.1-tem
# Install Java 17 (Temurin distribution recommended)
sdk install java 17.0.13-tem

# Verify installation
java -version
```

**Note**: The exact identifier (e.g., `25.0.1-tem`) may vary by platform and availability. Run `sdk list java` to see available Java 25 versions for your system and choose the appropriate one for your platform.
**Note**: The exact identifier (e.g., `17.0.13-tem`) may vary by platform and availability. Run `sdk list java` to see available Java 17 versions for your system and choose the appropriate one for your platform.

### Setting Up Your Development Environment

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Both the xAPI Client and xAPI Model use a [fluent interface](https://en.wikipedi

## Requirements

xAPI Java requires **Java 25 or newer**. See [CONTRIBUTING.md](CONTRIBUTING.md#prerequisites) for detailed installation instructions.
xAPI Java requires **Java 17 or newer**. See [CONTRIBUTING.md](CONTRIBUTING.md#prerequisites) for detailed installation instructions.

## xAPI Java Client

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>learning.dev xAPI Build</description>
<url>https://github.com/BerryCloud/xapi-java</url>
<properties>
<java.version>25</java.version>
<java.version>17</java.version>
<jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,17 @@ private List<Object> getParts(Object object) {

final var list = new ArrayList<>();

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;
};
final Stream<Attachment> attachments;

if (object instanceof Statement statement) {
attachments = getRealAttachments(statement);
} else if (object instanceof List<?> statements
&& !statements.isEmpty()
&& statements.get(0) instanceof Statement) {
attachments = ((List<Statement>) statements).stream().flatMap(this::getRealAttachments);
} else {
attachments = null;
}

if (attachments == null) {
// The object is not a statement or list of statements
Expand Down