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
13 changes: 9 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ jobs:
container:
image: ${{ matrix.os }}
steps:


- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Install dependencies on Ubuntu 22.04
if: matrix.os == 'ubuntu:22.04'
run: |
apt update -y
apt install -y default-jdk build-essential bison flex gettext texinfo automake autoconf
apt install -y build-essential bison flex gettext texinfo automake autoconf

- name: Install dependencies on AlmaLinux 9
if: matrix.os == 'almalinux:9'
run: |
dnf -y update
dnf install -y java-17-openjdk-devel gcc make bison flex automake autoconf diffutils gettext
dnf install -y gcc make bison flex automake autoconf diffutils gettext

- name: Checkout opensource COBOL 4J
uses: actions/checkout@v3
Expand Down Expand Up @@ -90,7 +95,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: '11'

- name: Install static analysis tools
run: |
Expand Down
93 changes: 0 additions & 93 deletions .github/workflows/coverage.yml

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/test-nist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ jobs:
with:
name: opensourcecobol4j-${{ env.ARTIFACT_NAME }}

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Install dependencies on Ubuntu 22.04
if: matrix.os == 'ubuntu:22.04'
run: |
apt update -y
apt install -y default-jdk build-essential
apt install -y build-essential

- name: Install dependencies on AlmaLinux 9
if: matrix.os == 'almalinux:9'
run: |
dnf -y update
dnf install -y java-17-openjdk-devel gcc make perl
dnf install -y gcc make perl

- name: Install opensource COBOL 4J
run: |
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,22 @@ jobs:
with:
name: opensourcecobol4j-${{ env.ARTIFACT_NAME }}

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Install dependencies on Ubuntu 22.04
if: matrix.os == 'ubuntu:22.04'
run: |
apt update -y
apt install -y default-jdk build-essential
apt install -y build-essential

- name: Install dependencies on AlmaLinux 9
if: matrix.os == 'almalinux:9'
run: |
dnf -y update
dnf install -y java-17-openjdk-devel gcc make diffutils
dnf install -y gcc make diffutils

- name: Install opensource COBOL 4J
run: |
Expand Down
14 changes: 13 additions & 1 deletion libcobj/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ repositories {
mavenCentral()
}

tasks {
javadoc {
options.encoding = "UTF-8"
}
compileJava {
options.encoding = "UTF-8"
}
compileTestJava {
options.encoding = "UTF-8"
}
}

dependencies {
implementation("com.google.guava:guava:31.1-jre")
implementation("org.xerial:sqlite-jdbc:3.30.1")
Expand All @@ -22,7 +34,7 @@ dependencies {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(8))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public int indexed_start_internal(
boolean isDuplicate = this.keys[p.key_index].getFlag() != 0;

this.cursor = IndexedCursor.createCursor(p.connection, p.key, p.key_index, isDuplicate, cond);
if (this.cursor.isEmpty()) {
if (!this.cursor.isPresent()) {
return COB_STATUS_30_PERMANENT_ERROR;
}

Expand Down Expand Up @@ -316,33 +316,33 @@ public int readNext(int readOpts) {
if (this.indexedFirstRead || this.flag_begin_of_file) {
this.cursor =
IndexedCursor.createCursor(p.connection, p.key, p.key_index, isDuplicate, COB_GE);
if (this.cursor.isEmpty()) {
if (!this.cursor.isPresent()) {
return COB_STATUS_10_END_OF_FILE;
}
this.cursor.get().moveToFirst();
} else if (this.flag_end_of_file) {
this.cursor =
IndexedCursor.createCursor(p.connection, p.key, p.key_index, isDuplicate, COB_LE);
if (this.cursor.isEmpty()) {
if (!this.cursor.isPresent()) {
return COB_STATUS_30_PERMANENT_ERROR;
}
this.cursor.get().moveToLast();
} else if (this.updateWhileReading) {
this.updateWhileReading = false;
if (this.cursor.isEmpty()) {
if (!this.cursor.isPresent()) {
return COB_STATUS_30_PERMANENT_ERROR;
}
IndexedCursor oldCursor = this.cursor.get();
Optional<IndexedCursor> newCursor = oldCursor.reloadCursor();
if (newCursor.isEmpty()) {
if (!newCursor.isPresent()) {
this.cursor = Optional.of(oldCursor);
} else {
oldCursor.close();
this.cursor = newCursor;
}
}

if (this.cursor.isEmpty()) {
if (!this.cursor.isPresent()) {
return COB_STATUS_30_PERMANENT_ERROR;
}

Expand All @@ -361,7 +361,7 @@ public int readNext(int readOpts) {

this.indexedFirstRead = false;

if (optionalResult.isEmpty()) {
if (!optionalResult.isPresent()) {
return COB_STATUS_10_END_OF_FILE;
} else {
FetchResult result = optionalResult.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static Optional<IndexedCursor> createCursor(
IndexedCursor cursor = new IndexedCursor(conn, key, tableIndex, isDuplicate, comparator);
cursor.forwardCursor = getCursor(conn, key, tableIndex, isDuplicate, comparator, true);
cursor.backwardCursor = getCursor(conn, key, tableIndex, isDuplicate, comparator, false);
if (cursor.forwardCursor.isEmpty() || cursor.backwardCursor.isEmpty()) {
if (!cursor.forwardCursor.isPresent() || !cursor.backwardCursor.isPresent()) {
return Optional.empty();
} else {
return Optional.of(cursor);
Expand Down Expand Up @@ -178,14 +178,14 @@ public Optional<IndexedCursor> reloadCursor() {

Optional<FetchResult> reFetchResult =
reFetch(this.conn, this.tableIndex, this.isDuplicate, result);
if (!reFetchResult.isEmpty()) {
if (reFetchResult.isPresent()) {
FetchResult r = reFetchResult.get();
newCursor.forwardBuffer.add(r);
newCursor.cursorIndex = 0;
newCursor.firstFetch = false;
}

if (newCursor.forwardCursor.isEmpty() || newCursor.backwardCursor.isEmpty()) {
if (!newCursor.forwardCursor.isPresent() || !newCursor.backwardCursor.isPresent()) {
return Optional.empty();
} else {
return Optional.of(newCursor);
Expand Down Expand Up @@ -409,7 +409,7 @@ private Optional<FetchResult> fetchPrev(ResultSet cursor) {
* return Optional.empty()
*/
public Optional<FetchResult> next() {
if (this.forwardCursor.isEmpty()) {
if (!this.forwardCursor.isPresent()) {
return Optional.empty();
}
ResultSet cursor = this.forwardCursor.get();
Expand Down Expand Up @@ -458,7 +458,7 @@ public Optional<FetchResult> next() {
* return Optional.empty()
*/
public Optional<FetchResult> prev() {
if (this.backwardCursor.isEmpty()) {
if (!this.backwardCursor.isPresent()) {
return Optional.empty();
}
ResultSet cursor = this.backwardCursor.get();
Expand Down Expand Up @@ -524,7 +524,7 @@ private static Optional<ResultSet> getCursor(
boolean forward) {
final Optional<String> optionalCompOperator = getCompOperator(comparator, forward);

if (optionalCompOperator.isEmpty()) {
if (!optionalCompOperator.isPresent()) {
return Optional.empty();
}

Expand Down Expand Up @@ -617,7 +617,7 @@ private Optional<ResultSet> getCursorForFirstLast(
public boolean moveToFirst() {
Optional<ResultSet> cursor =
getCursorForFirstLast(this.tableIndex, this.isDuplicate, CursorReadOption.FIRST);
if (cursor.isEmpty()) {
if (!cursor.isPresent()) {
return false;
}
this.forwardCursor = cursor;
Expand All @@ -630,7 +630,7 @@ public boolean moveToFirst() {
public boolean moveToLast() {
Optional<ResultSet> cursor =
getCursorForFirstLast(this.tableIndex, this.isDuplicate, CursorReadOption.LAST);
if (cursor.isEmpty()) {
if (!cursor.isPresent()) {
return false;
}
this.backwardCursor = cursor;
Expand Down