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
8 changes: 4 additions & 4 deletions .github/workflows/mvn-release-prepare-perform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ jobs:
steps:
- id: 'checkout'
name: 'Step: Check Out Project'
uses: 'actions/checkout@v4'
uses: 'actions/checkout@v6'
with:
fetch-depth: 1
persist-credentials: false
- id: 'setup-java'
name: 'Step: Set Up Java and Maven'
uses: 'actions/setup-java@v4'
uses: 'actions/setup-java@v5'
with:
cache: 'maven'
distribution: 'temurin'
gpg-passphrase: 'GPG_PASSPHRASE'
gpg-private-key: '${{ secrets.GPG_PRIVATE_KEY }}'
java-version: '24'
mvn-toolchain-id: 'Temurin 24'
java-version: '25'
mvn-toolchain-id: 'Temurin 25'
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
server-id: 'central.sonatype.com'
server-password: 'CENTRAL_SONATYPE_COM_PASSWORD'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/mvn-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
steps:
- id: 'checkout'
name: 'Step: Checkout'
uses: 'actions/checkout@v4'
uses: 'actions/checkout@v6'
with:
fetch-depth: 1
persist-credentials: false
- id: 'setup-java'
name: 'Step: Set Up Java and Maven'
uses: 'actions/setup-java@v4'
uses: 'actions/setup-java@v5'
with:
cache: 'maven'
distribution: 'temurin'
java-version: '24'
mvn-toolchain-id: 'Temurin 24'
java-version: '25'
mvn-toolchain-id: 'Temurin 25'
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
- id: 'mvn-verify'
name: 'Step: Maven Verify'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ as a Maven dependency:
Always check https://search.maven.org/artifact/org.microbean/microbean-construct
for up-to-date available versions.
-->
<version>0.0.16</version>
<version>0.0.17</version>
</dependency>
```

Expand Down
28 changes: 14 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.13.2</version>
<version>6.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -139,7 +139,7 @@
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -166,7 +166,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<version>3.14.1</version>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
Expand All @@ -176,15 +176,15 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
<version>3.9.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.4</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.1</version>
<version>3.6.2</version>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -196,11 +196,11 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<version>3.5.0</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<version>3.12.0</version>
<configuration>
<docfilessubdirs>true</docfilessubdirs>
</configuration>
Expand All @@ -215,15 +215,15 @@
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>2.1.0</version>
<version>2.2.1</version>
</plugin>
<plugin>
<artifactId>maven-scm-publish-plugin</artifactId>
Expand All @@ -247,7 +247,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<version>3.5.4</version>
</plugin>
<plugin>
<artifactId>maven-toolchains-plugin</artifactId>
Expand All @@ -256,22 +256,22 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.9.4.0</version>
<version>4.9.8.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.18.0</version>
<version>2.19.1</version>
</plugin>
<plugin>
<groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central.sonatype.com</publishingServerId>
Expand Down
39 changes: 37 additions & 2 deletions src/main/java/org/microbean/construct/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import static javax.lang.model.element.ElementKind.CONSTRUCTOR;
import static javax.lang.model.element.ElementKind.METHOD;

import static javax.lang.model.type.TypeKind.DECLARED;

/**
* A representation of a domain of valid Java constructs.
*
Expand All @@ -82,6 +84,8 @@
* <p>{@link Domain} implementations must be thread-safe.</p>
*
* @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a>
*
* @see <a href="https://bugs.openjdk.org/browse/JDK-8055219">JDK-8055219</a>
*/
@SuppressWarnings("try")
public interface Domain {
Expand Down Expand Up @@ -646,7 +650,7 @@ public default boolean javaLangObject(final TypeMirror t) {
default -> {
try (var lock = this.lock()) {
yield
t.getKind() == TypeKind.DECLARED &&
t.getKind() == DECLARED &&
javaLangObject(((DeclaredType)t).asElement());
}
}
Expand Down Expand Up @@ -839,7 +843,7 @@ public default boolean parameterized(final TypeMirror t) {
case UniversalType ut -> ut.parameterized();
default -> {
try (var lock = this.lock()) {
yield t.getKind() == TypeKind.DECLARED && !((DeclaredType)t).getTypeArguments().isEmpty();
yield t.getKind() == DECLARED && !((DeclaredType)t).getTypeArguments().isEmpty();
}
}
};
Expand Down Expand Up @@ -957,6 +961,35 @@ public default PrimitiveType primitiveType(final TypeElement e) {
// (Unboxing.)
public PrimitiveType primitiveType(final TypeMirror t);

/**
* A convenience method that returns {@code true} if and only if the supplied {@link TypeMirror} represents a
* <dfn>prototypical type</dfn>.
*
* <p>Prototypical types are not defined by the Java Language Specification. They are partially defined by the
* {@linkplain TypeElement#asType() specification of the <code>TypeElement#asType()</code>
* method}.</p>
*
* @param t a {@link TypeMirror}; must not be {@code null}
*
* @return {@code true} if and only if this {@link UniversalType} represents a <dfn>prototypical type</dfn>
*
* @exception NullPointerException if {@code t} is {@code null}
*
* @see TypeElement#asType()
*/
// (Convenience.)
public default boolean prototypical(final TypeMirror t) {
return switch (t) {
case null -> throw new NullPointerException("t");
case UniversalType ut -> ut.prototypical();
default -> {
try (var lock = this.lock()) {
yield t.getKind() == DECLARED && t.equals(((DeclaredType)t).asElement().asType());
}
}
};
}

/**
* A convenience method that returns {@code true} if and only if the supplied {@link TypeMirror} is a <dfn>raw
* type</dfn> according to <a href="https://docs.oracle.com/javase/specs/jls/se23/html/jls-4.html#jls-4.8">the rules
Expand Down Expand Up @@ -1064,6 +1097,8 @@ yield switch (t.getKind()) {
*
* @see javax.lang.model.util.Types#isSameType(TypeMirror, TypeMirror)
*
* @see <a href="https://bugs.openjdk.org/browse/JDK-8055219">JDK-8055219</a>
*
* @spec https://docs.oracle.com/javase/specs/jls/se23/html/jls-4.html#jls-4.3.4 Java Language Specification, section
* 4.3.4
*
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/microbean/construct/Processor.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ final class Processor implements AutoCloseable, javax.annotation.processing.Proc

private final Consumer<? super ProcessingEnvironment> cpe;

// run() method invoked under lock
private final Runnable r;

private final Lock lock;
Expand Down
Loading