Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target java17 #5045

Merged
merged 13 commits into from
Oct 31, 2024
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [11, 17, 22]
java_version: [17, 21, 22]

steps:
- name: Environment
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [11, 21]
java_version: [17, 21]
test_mode: ["test_integration", "test_docs", "test_aws", "test_azure", "test_google", "test_wave"]
steps:
- name: Checkout
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ allprojects {
}

compileJava {
options.release.set(11)
options.release.set(17)
}

tasks.withType(GroovyCompile) {
sourceCompatibility = '11'
targetCompatibility = '11'
sourceCompatibility = '17'
targetCompatibility = '17'
}

idea {
Expand Down Expand Up @@ -147,7 +147,6 @@ allprojects {
// Required to run tests on Java 9 and higher in compatibility mode
tasks.withType(Test) {
jvmArgs ([
'-Dorg.spockframework.mock.ignoreByteBuddy=true',
'--enable-preview',
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
Expand Down
8 changes: 4 additions & 4 deletions modules/nextflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ dependencies {

// test configuration
testFixturesApi ("org.apache.groovy:groovy-test:4.0.22") { exclude group: 'org.apache.groovy' }
testFixturesApi ("cglib:cglib-nodep:3.3.0")
testFixturesApi ("org.objenesis:objenesis:3.2")
testFixturesApi ("org.spockframework:spock-core:2.3-groovy-4.0") { exclude group: 'org.apache.groovy'; exclude group: 'net.bytebuddy' }
testFixturesApi ('org.spockframework:spock-junit4:2.3-groovy-4.0') { exclude group: 'org.apache.groovy'; exclude group: 'net.bytebuddy' }
testFixturesApi ("org.objenesis:objenesis:3.4")
testFixturesApi ("net.bytebuddy:byte-buddy:1.14.17")
pditommaso marked this conversation as resolved.
Show resolved Hide resolved
testFixturesApi ("org.spockframework:spock-core:2.3-groovy-4.0") { exclude group: 'org.apache.groovy' }
testFixturesApi ('org.spockframework:spock-junit4:2.3-groovy-4.0') { exclude group: 'org.apache.groovy' }
testFixturesApi 'com.google.jimfs:jimfs:1.2'

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ final class AzureRepositoryProvider extends RepositoryProvider {
List<BranchInfo> getBranches() {
// https://docs.microsoft.com/en-us/rest/api/azure/devops/git/refs/list?view=azure-devops-rest-6.0#refs-heads
final url = "$endpointUrl/refs?filter=heads&api-version=6.0"
this.<BranchInfo>invokeAndResponseWithPaging(url, { Map branch ->
this.invokeAndResponseWithPaging(url, { Map branch ->
new BranchInfo(strip(branch.name), branch.objectId as String)
})
}
Expand All @@ -104,7 +104,7 @@ final class AzureRepositoryProvider extends RepositoryProvider {
List<TagInfo> getTags() {
// https://docs.microsoft.com/en-us/rest/api/azure/devops/git/refs/list?view=azure-devops-rest-6.0#refs-tags
final url = "$endpointUrl/refs?filter=tags&api-version=6.0"
this.<TagInfo>invokeAndResponseWithPaging(url, { Map tag ->
this.invokeAndResponseWithPaging(url, { Map tag ->
new TagInfo(strip(tag.name), tag.objectId as String)
})
}
Expand All @@ -118,9 +118,10 @@ final class AzureRepositoryProvider extends RepositoryProvider {
.replace('refs/heads/','')
}

// NOTE: @Memoized with <T> does not work with bytebuddy
@Memoized
protected <T> List<T> invokeAndResponseWithPaging(String url, Closure<T> parse) {
final result = new ArrayList<T>(50)
protected List invokeAndResponseWithPaging(String url, Closure parse) {
final result = new ArrayList(50)
do {
final resp = invokeAndParseResponse(url)
final tags = resp.value as List<Map>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ abstract class RepositoryProvider {
}
}

// NOTE: @Memoized with <T> does not work with bytebuddy
@Memoized
protected <T> List<T> invokeAndResponseWithPaging(String request, Closure<T> parse) {
protected List invokeAndResponseWithPaging(String request, Closure parse) {
pditommaso marked this conversation as resolved.
Show resolved Hide resolved
int page = 0
final result = new ArrayList()
while( true ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,17 @@ class AzFileSystem extends FileSystem {
* @param cond A predicate that determines when a retry should be triggered
* @return The {@link dev.failsafe.RetryPolicy} instance
*/
// NOTE: @Memoized with <T> does not work with bytebuddy
@Memoized
protected <T> RetryPolicy<T> retryPolicy(Predicate<? extends Throwable> cond) {
protected RetryPolicy retryPolicy(Predicate<? extends Throwable> cond) {
final cfg = AzConfig.getConfig().retryConfig()
final listener = new EventListener<ExecutionAttemptedEvent>() {
@Override
void accept(ExecutionAttemptedEvent event) throws Throwable {
log.debug("Azure I/O exception - attempt: ${event.attemptCount}; cause: ${event.lastFailure?.message}")
}
}
return RetryPolicy.<T>builder()
return RetryPolicy.builder()
.handleIf(cond)
.withBackoff(cfg.delay.toMillis(), cfg.maxDelay.toMillis(), ChronoUnit.MILLIS)
.withMaxAttempts(cfg.maxAttempts)
Expand Down