From b2627cb3643a56d4eb3e0b89f9aefdae4904c7bd Mon Sep 17 00:00:00 2001 From: vsilaev Date: Mon, 29 May 2023 16:59:31 +0300 Subject: [PATCH] Prepare next release --- README.md | 26 +++++++++---------- net.tascalate.async.agent/pom.xml | 2 +- net.tascalate.async.examples/build.gradle | 16 ++++++------ net.tascalate.async.examples/pom.xml | 2 +- .../async/examples/generator/SimpleArgs.java | 4 +-- .../nio/AsyncAwaitNioFileChannelDemo.java | 1 + net.tascalate.async.extras/pom.xml | 2 +- .../pom.xml | 2 +- net.tascalate.async.resolver.provided/pom.xml | 2 +- net.tascalate.async.resolver.scoped/pom.xml | 2 +- net.tascalate.async.resolver.swing/pom.xml | 2 +- net.tascalate.async.runtime/pom.xml | 2 +- net.tascalate.async.tools.core/pom.xml | 2 +- .../core/AbstractAsyncMethodTransformer.java | 9 +++---- net.tascalate.async.tools.gradle/.classpath | 5 ++++ net.tascalate.async.tools.gradle/pom.xml | 2 +- net.tascalate.async.tools.maven/pom.xml | 2 +- pom.xml | 10 +++---- 18 files changed, 49 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index c4ab9af..a5c2dca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Maven Central](https://img.shields.io/maven-central/v/net.tascalate.async/net.tascalate.async.parent.svg)](https://search.maven.org/artifact/net.tascalate.async/net.tascalate.async.parent/1.2.5/pom) [![GitHub release](https://img.shields.io/github/release/vsilaev/tascalate-async-await.svg)](https://github.com/vsilaev/tascalate-async-await/releases/tag/1.2.5) [![license](https://img.shields.io/github/license/vsilaev/tascalate-async-await.svg)](https://github.com/vsilaev/tascalate-async-await/blob/master/LICENSE) +[![Maven Central](https://img.shields.io/maven-central/v/net.tascalate.async/net.tascalate.async.parent.svg)](https://search.maven.org/artifact/net.tascalate.async/net.tascalate.async.parent/1.2.6/pom) [![GitHub release](https://img.shields.io/github/release/vsilaev/tascalate-async-await.svg)](https://github.com/vsilaev/tascalate-async-await/releases/tag/1.2.6) [![license](https://img.shields.io/github/license/vsilaev/tascalate-async-await.svg)](https://github.com/vsilaev/tascalate-async-await/blob/master/LICENSE) # Why async-await? Asynchronous programming has long been a useful way to perform operations that don’t necessarily need to hold up the flow or responsiveness of an application. Generally, these are either compute-bound operations or I/O bound operations. Compute-bound operations are those where computations can be done on a separate thread, leaving the main thread to continue its own processing, while I/O bound operations involve work that takes place externally and may not need to block a thread while such work takes place. Common examples of I/O bound operations are file and network operations. @@ -18,7 +18,7 @@ First, add Maven dependency to the library runtime: net.tascalate.async net.tascalate.async.runtime - 1.2.5 + 1.2.6 ``` Second, add the following build plugins in the specified order: @@ -29,7 +29,7 @@ Second, add the following build plugins in the specified order: net.tascalate.async net.tascalate.async.tools.maven - 1.2.5 + 1.2.6 tascalate-async-enhance-main-classes @@ -52,7 +52,7 @@ Second, add the following build plugins in the specified order: net.tascalate.javaflow net.tascalate.javaflow.tools.maven - 2.7.3 + 2.7.5 javaflow-enhance-main-classes @@ -85,8 +85,8 @@ buildscript { } dependencies { - classpath 'net.tascalate.async:net.tascalate.async.tools.gradle:1.2.5' - classpath 'net.tascalate.javaflow:net.tascalate.javaflow.tools.gradle:2.7.3' + classpath 'net.tascalate.async:net.tascalate.async.tools.gradle:1.2.6' + classpath 'net.tascalate.javaflow:net.tascalate.javaflow.tools.gradle:2.7.5' /* other plugins */ } } @@ -101,7 +101,7 @@ repositories { } dependencies { - implementation 'net.tascalate.async:net.tascalate.async.runtime:1.2.5' + implementation 'net.tascalate.async:net.tascalate.async.runtime:1.2.6' /* other dependencies */ } ``` @@ -113,8 +113,8 @@ buildscript { } dependencies { - classpath 'net.tascalate.async:net.tascalate.async.tools.gradle:1.2.5' - classpath 'net.tascalate.javaflow:net.tascalate.javaflow.tools.gradle:2.7.3' + classpath 'net.tascalate.async:net.tascalate.async.tools.gradle:1.2.6' + classpath 'net.tascalate.javaflow:net.tascalate.javaflow.tools.gradle:2.7.5' /* other plugins */ } } @@ -129,10 +129,10 @@ repositories { } dependencies { - implementation 'net.tascalate.async:net.tascalate.async.runtime:1.2.5' + implementation 'net.tascalate.async:net.tascalate.async.runtime:1.2.6' /* Async/Await Extras */ - implementation 'net.tascalate.async:net.tascalate.async.extras:1.2.5' + implementation 'net.tascalate.async:net.tascalate.async.extras:1.2.6' /* Promise implementation */ /* Necessary because net.tascalate.async.extras uses it as an */ @@ -140,9 +140,9 @@ dependencies { implementation 'net.tascalate:net.tascalate.concurrent:0.9.6' /* Necessary only for different providers */ - runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.provided:1.2.5' + runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.provided:1.2.6' /* - runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.propagated:1.2.5' + runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.propagated:1.2.6' */ diff --git a/net.tascalate.async.agent/pom.xml b/net.tascalate.async.agent/pom.xml index c8a9615..5549ad6 100644 --- a/net.tascalate.async.agent/pom.xml +++ b/net.tascalate.async.agent/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.examples/build.gradle b/net.tascalate.async.examples/build.gradle index a6f2ff7..264049d 100644 --- a/net.tascalate.async.examples/build.gradle +++ b/net.tascalate.async.examples/build.gradle @@ -4,8 +4,8 @@ buildscript { } dependencies { - classpath 'net.tascalate.async:net.tascalate.async.tools.gradle:1.2.5' - classpath 'net.tascalate.javaflow:net.tascalate.javaflow.tools.gradle:2.7.3' + classpath 'net.tascalate.async:net.tascalate.async.tools.gradle:1.2.6' + classpath 'net.tascalate.javaflow:net.tascalate.javaflow.tools.gradle:2.7.5' } } @@ -19,12 +19,12 @@ repositories { } dependencies { - implementation 'net.tascalate.async:net.tascalate.async.runtime:1.2.5' - implementation 'net.tascalate.async:net.tascalate.async.extras:1.2.5' + implementation 'net.tascalate.async:net.tascalate.async.runtime:1.2.6' + implementation 'net.tascalate.async:net.tascalate.async.extras:1.2.6' /* Necessary only for different providers */ - runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.propagated:1.2.5' - runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.provided:1.2.5' + runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.propagated:1.2.6' + runtimeOnly 'net.tascalate.async:net.tascalate.async.resolver.provided:1.2.6' /* Promise implementation */ /* Necessary because net.tascalate.async.extras uses it as an */ @@ -32,7 +32,7 @@ dependencies { implementation 'net.tascalate:net.tascalate.concurrent:0.9.6' /* When used with Async/Await Java Agent and dynamic open modules */ - implementation 'net.tascalate.instrument:net.tascalate.instrument.emitter:1.3.0' + implementation 'net.tascalate.instrument:net.tascalate.instrument.emitter:1.3.2' testImplementation 'junit:junit:4.13.2' } @@ -44,7 +44,7 @@ dependencies { } group = 'net.tascalate.async.examples' -version = '1.2.5' +version = '1.2.6' description = 'Tascalate Async/Await - Simple Examples' java.sourceCompatibility = JavaVersion.VERSION_1_9 diff --git a/net.tascalate.async.examples/pom.xml b/net.tascalate.async.examples/pom.xml index eaa71b2..ed58a81 100644 --- a/net.tascalate.async.examples/pom.xml +++ b/net.tascalate.async.examples/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/generator/SimpleArgs.java b/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/generator/SimpleArgs.java index 4fc9f27..280ee86 100644 --- a/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/generator/SimpleArgs.java +++ b/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/generator/SimpleArgs.java @@ -103,7 +103,7 @@ public static void main(String[] args) { } @async - Promise outerCallExplicit(String delimeter, @SchedulerProvider Scheduler scheduler, int zz) { + Promise outerCallExplicit(String delimeter, @SchedulerProvider Scheduler scheduler, int zz) { System.out.println("Outer call explicit, current scheduler - " + CurrentCallContext.scheduler()); System.out.println("Outer call explicit, thread : " + Thread.currentThread().getName()); await(innerCallImplicit()); @@ -125,7 +125,7 @@ Promise outerCallExplicit(String delimeter, @SchedulerProvider Scheduler } @async - Promise innerCallImplicit() { + Promise innerCallImplicit() { System.out.println("Inner call explicit, current scheduler - " + CurrentCallContext.scheduler()); String v = await(CompletableFuture.supplyAsync(() -> "XYZ", executor)); System.out.println("Inner call explicit, thread : " + Thread.currentThread().getName()); diff --git a/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/nio/AsyncAwaitNioFileChannelDemo.java b/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/nio/AsyncAwaitNioFileChannelDemo.java index d9f9fa1..46c7537 100644 --- a/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/nio/AsyncAwaitNioFileChannelDemo.java +++ b/net.tascalate.async.examples/src/main/java/net/tascalate/async/examples/nio/AsyncAwaitNioFileChannelDemo.java @@ -61,6 +61,7 @@ public static void main(final String[] argv) throws Exception { System.out.println("Result " + LocalTime.now()); System.out.println(r); } + executor.shutdown(); }); // Need to wait because NIO uses daemon threads that do not prevent program exit diff --git a/net.tascalate.async.extras/pom.xml b/net.tascalate.async.extras/pom.xml index 6c83f96..12d2165 100644 --- a/net.tascalate.async.extras/pom.xml +++ b/net.tascalate.async.extras/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.resolver.propagated/pom.xml b/net.tascalate.async.resolver.propagated/pom.xml index 0db9d72..ca6110d 100644 --- a/net.tascalate.async.resolver.propagated/pom.xml +++ b/net.tascalate.async.resolver.propagated/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.resolver.provided/pom.xml b/net.tascalate.async.resolver.provided/pom.xml index 53f2fcc..aed20a5 100644 --- a/net.tascalate.async.resolver.provided/pom.xml +++ b/net.tascalate.async.resolver.provided/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.resolver.scoped/pom.xml b/net.tascalate.async.resolver.scoped/pom.xml index b47d8a9..f087ddd 100644 --- a/net.tascalate.async.resolver.scoped/pom.xml +++ b/net.tascalate.async.resolver.scoped/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.resolver.swing/pom.xml b/net.tascalate.async.resolver.swing/pom.xml index 5ad589d..5775e72 100644 --- a/net.tascalate.async.resolver.swing/pom.xml +++ b/net.tascalate.async.resolver.swing/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.runtime/pom.xml b/net.tascalate.async.runtime/pom.xml index 43248ad..12d0353 100644 --- a/net.tascalate.async.runtime/pom.xml +++ b/net.tascalate.async.runtime/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.tools.core/pom.xml b/net.tascalate.async.tools.core/pom.xml index 7cfdce5..c4b8c1a 100644 --- a/net.tascalate.async.tools.core/pom.xml +++ b/net.tascalate.async.tools.core/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.tools.core/src/main/java/net/tascalate/async/tools/core/AbstractAsyncMethodTransformer.java b/net.tascalate.async.tools.core/src/main/java/net/tascalate/async/tools/core/AbstractAsyncMethodTransformer.java index 54540e3..3ff37fa 100644 --- a/net.tascalate.async.tools.core/src/main/java/net/tascalate/async/tools/core/AbstractAsyncMethodTransformer.java +++ b/net.tascalate.async.tools.core/src/main/java/net/tascalate/async/tools/core/AbstractAsyncMethodTransformer.java @@ -471,11 +471,9 @@ protected void createAccessMethodsForAsyncMethod() { if (instruction instanceof MethodInsnNode) { MethodInsnNode methodInstructionNode = (MethodInsnNode) instruction; boolean isOwnMethod = methodInstructionNode.owner.equals(classNode.name); + int mopcode = methodInstructionNode.getOpcode(); if ( - (methodInstructionNode.getOpcode() == INVOKEVIRTUAL || - methodInstructionNode.getOpcode() == INVOKESPECIAL || - methodInstructionNode.getOpcode() == INVOKESTATIC - ) && + (mopcode == INVOKEVIRTUAL || mopcode == INVOKESPECIAL || mopcode == INVOKESTATIC) && (isOwnMethod || helper.isSubClass(classNode.name, methodInstructionNode.owner))) { String actualClassName; @@ -496,7 +494,7 @@ protected void createAccessMethodsForAsyncMethod() { boolean samePackageAccessible = // Note that INVOKESPECIAL IS NOT ACCESSIBLE OTSIDE CLASS ITSELF AT ALL - (methodInstructionNode.getOpcode() == INVOKEVIRTUAL || methodInstructionNode.getOpcode() == INVOKESTATIC) && + (mopcode == INVOKEVIRTUAL || mopcode == INVOKESTATIC || (mopcode == INVOKESPECIAL && "".equals(methodInstructionNode.name))) && null != targetMethodNode && (targetMethodNode.access & ACC_PRIVATE) == 0 && ((targetMethodNode.access & ACC_PUBLIC) != 0 || samePackage(classNode.name, actualClassName)); @@ -505,6 +503,7 @@ protected void createAccessMethodsForAsyncMethod() { if (log.isTraceEnabled()) { log.trace("Found private call " + BytecodeTraceUtil.toString(methodInstructionNode)); } + // TODO Add special handling for private constructor calls createAccessMethod(methodInstructionNode, methods); } } diff --git a/net.tascalate.async.tools.gradle/.classpath b/net.tascalate.async.tools.gradle/.classpath index 2739276..c439b28 100644 --- a/net.tascalate.async.tools.gradle/.classpath +++ b/net.tascalate.async.tools.gradle/.classpath @@ -24,5 +24,10 @@ + + + + + diff --git a/net.tascalate.async.tools.gradle/pom.xml b/net.tascalate.async.tools.gradle/pom.xml index 6c91713..faf60b0 100644 --- a/net.tascalate.async.tools.gradle/pom.xml +++ b/net.tascalate.async.tools.gradle/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/net.tascalate.async.tools.maven/pom.xml b/net.tascalate.async.tools.maven/pom.xml index 75bc5f4..b898bac 100644 --- a/net.tascalate.async.tools.maven/pom.xml +++ b/net.tascalate.async.tools.maven/pom.xml @@ -5,7 +5,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 ../ diff --git a/pom.xml b/pom.xml index c0d4068..fe2ea66 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ net.tascalate.async net.tascalate.async.parent - 1.2.5 + 1.2.6 pom Tascalate Async/Await @@ -52,10 +52,10 @@ UTF-8 0.9.6 - 2.7.3 + 2.7.5 2.4.3 - 9.3.0 - 1.3.0 + 9.5.0 + 1.3.2 @@ -245,7 +245,7 @@ org.moditect moditect-maven-plugin - 1.0.0.Beta2 + 1.0.0.Final add-module-infos