Skip to content

Commit

Permalink
Fix error with accessibility of the inherited fields / methods in gen…
Browse files Browse the repository at this point in the history
…erated classes
  • Loading branch information
vsilaev committed Feb 17, 2022
1 parent c717b74 commit 01b9442
Show file tree
Hide file tree
Showing 20 changed files with 208 additions and 67 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.1/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.1) [![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.2/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.2) [![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.

Expand All @@ -17,7 +17,7 @@ First, add Maven dependency to the library runtime:
<dependency>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.runtime</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
</dependency>
```
Second, add the following build plugins in the specified order:
Expand All @@ -27,7 +27,7 @@ Second, add the following build plugins in the specified order:
<plugin>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.tools.maven</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<executions>
<execution>
<phase>process-classes</phase>
Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.tascalate.async.examples.generator;

import net.tascalate.async.examples.generator.base.BaseClass;

public class SamePackageSubclass extends BaseClass {
protected String samePackageField = "XYZ";

protected long samePackageMethod(long v) {
return v * 1000;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import net.tascalate.concurrent.Promise;
import net.tascalate.concurrent.Promises;

public class SimpleArgs {
public class SimpleArgs extends SamePackageSubclass {
final private static AtomicLong idx = new AtomicLong(0);
final private static ExecutorService executor = Executors.newFixedThreadPool(4, new ThreadFactory() {
@Override
Expand Down Expand Up @@ -48,6 +48,12 @@ public static void main(String[] args) {
x.hashCode();
System.out.println(Thread.currentThread().getName());
System.out.println(abs + " -- " + x + ", " + scheduler);
System.out.println("Inherited method (other package) " + inheritedMethod(10));
System.out.println("Inherited method (same package) " + samePackageMethod(10));
System.out.println("Inherited method (public method) " + super.publicMethod());
System.out.println("Inherited field (other package) " + inheritedField);
System.out.println("Inherited field (same package) " + samePackageField);
System.out.println("Inherited field (public field) " + publicField);
return async(new Date());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.tascalate.async.examples.generator.base;

public class BaseClass {
protected String inheritedField = "123";
public String publicField = "ABC";

protected String inheritedMethod(long v) {
return String.valueOf(10 * v);
}

public String publicMethod() {
return "12345";
}
}
2 changes: 1 addition & 1 deletion net.tascalate.async.extras/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.resolver.propagated/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.resolver.provided/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.resolver.scoped/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.resolver.swing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion net.tascalate.async.tools.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.tascalate.async</groupId>
<artifactId>net.tascalate.async.parent</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 01b9442

Please sign in to comment.