Skip to content

Commit ecfd839

Browse files
authored
Fixes #31; upgrades dependencies and workflows (#32)
Signed-off-by: Laird Nelson <[email protected]>
1 parent b4c23a3 commit ecfd839

18 files changed

+753
-447
lines changed

.github/workflows/mvn-release-prepare-perform.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ jobs:
2424
steps:
2525
- id: 'checkout'
2626
name: 'Step: Check Out Project'
27-
uses: 'actions/checkout@v4'
27+
uses: 'actions/checkout@v6'
2828
with:
2929
fetch-depth: 1
3030
persist-credentials: false
3131
- id: 'setup-java'
3232
name: 'Step: Set Up Java and Maven'
33-
uses: 'actions/setup-java@v4'
33+
uses: 'actions/setup-java@v5'
3434
with:
3535
cache: 'maven'
3636
distribution: 'temurin'
3737
gpg-passphrase: 'GPG_PASSPHRASE'
3838
gpg-private-key: '${{ secrets.GPG_PRIVATE_KEY }}'
39-
java-version: '24'
40-
mvn-toolchain-id: 'Temurin 24'
39+
java-version: '25'
40+
mvn-toolchain-id: 'Temurin 25'
4141
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
4242
server-id: 'central.sonatype.com'
4343
server-password: 'CENTRAL_SONATYPE_COM_PASSWORD'

.github/workflows/mvn-verify.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
steps:
1313
- id: 'checkout'
1414
name: 'Step: Checkout'
15-
uses: 'actions/checkout@v4'
15+
uses: 'actions/checkout@v6'
1616
with:
1717
fetch-depth: 1
1818
persist-credentials: false
1919
- id: 'setup-java'
2020
name: 'Step: Set Up Java and Maven'
21-
uses: 'actions/setup-java@v4'
21+
uses: 'actions/setup-java@v5'
2222
with:
2323
cache: 'maven'
2424
distribution: 'temurin'
25-
java-version: '24'
26-
mvn-toolchain-id: 'Temurin 24'
25+
java-version: '25'
26+
mvn-toolchain-id: 'Temurin 25'
2727
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
2828
- id: 'mvn-verify'
2929
name: 'Step: Maven Verify'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ as a Maven dependency:
3131
Always check https://search.maven.org/artifact/org.microbean/microbean-construct
3232
for up-to-date available versions.
3333
-->
34-
<version>0.0.16</version>
34+
<version>0.0.17</version>
3535
</dependency>
3636
```
3737

pom.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<dependency>
109109
<groupId>org.junit</groupId>
110110
<artifactId>junit-bom</artifactId>
111-
<version>5.13.2</version>
111+
<version>6.0.1</version>
112112
<type>pom</type>
113113
<scope>import</scope>
114114
</dependency>
@@ -139,7 +139,7 @@
139139
<plugins>
140140
<plugin>
141141
<artifactId>maven-antrun-plugin</artifactId>
142-
<version>3.1.0</version>
142+
<version>3.2.0</version>
143143
</plugin>
144144
<plugin>
145145
<artifactId>maven-assembly-plugin</artifactId>
@@ -166,7 +166,7 @@
166166
</plugin>
167167
<plugin>
168168
<artifactId>maven-compiler-plugin</artifactId>
169-
<version>3.14.0</version>
169+
<version>3.14.1</version>
170170
<configuration>
171171
<compilerArgs>
172172
<arg>-Xlint:all</arg>
@@ -176,15 +176,15 @@
176176
</plugin>
177177
<plugin>
178178
<artifactId>maven-dependency-plugin</artifactId>
179-
<version>3.8.1</version>
179+
<version>3.9.0</version>
180180
</plugin>
181181
<plugin>
182182
<artifactId>maven-deploy-plugin</artifactId>
183183
<version>3.1.4</version>
184184
</plugin>
185185
<plugin>
186186
<artifactId>maven-enforcer-plugin</artifactId>
187-
<version>3.6.1</version>
187+
<version>3.6.2</version>
188188
</plugin>
189189
<plugin>
190190
<artifactId>maven-gpg-plugin</artifactId>
@@ -196,11 +196,11 @@
196196
</plugin>
197197
<plugin>
198198
<artifactId>maven-jar-plugin</artifactId>
199-
<version>3.4.2</version>
199+
<version>3.5.0</version>
200200
</plugin>
201201
<plugin>
202202
<artifactId>maven-javadoc-plugin</artifactId>
203-
<version>3.11.3</version>
203+
<version>3.12.0</version>
204204
<configuration>
205205
<docfilessubdirs>true</docfilessubdirs>
206206
</configuration>
@@ -215,15 +215,15 @@
215215
</plugin>
216216
<plugin>
217217
<artifactId>maven-release-plugin</artifactId>
218-
<version>3.1.1</version>
218+
<version>3.2.0</version>
219219
</plugin>
220220
<plugin>
221221
<artifactId>maven-resources-plugin</artifactId>
222222
<version>3.3.1</version>
223223
</plugin>
224224
<plugin>
225225
<artifactId>maven-scm-plugin</artifactId>
226-
<version>2.1.0</version>
226+
<version>2.2.1</version>
227227
</plugin>
228228
<plugin>
229229
<artifactId>maven-scm-publish-plugin</artifactId>
@@ -247,7 +247,7 @@
247247
</plugin>
248248
<plugin>
249249
<artifactId>maven-surefire-plugin</artifactId>
250-
<version>3.5.3</version>
250+
<version>3.5.4</version>
251251
</plugin>
252252
<plugin>
253253
<artifactId>maven-toolchains-plugin</artifactId>
@@ -256,22 +256,22 @@
256256
<plugin>
257257
<groupId>com.github.spotbugs</groupId>
258258
<artifactId>spotbugs-maven-plugin</artifactId>
259-
<version>4.9.4.0</version>
259+
<version>4.9.8.1</version>
260260
</plugin>
261261
<plugin>
262262
<groupId>org.codehaus.mojo</groupId>
263263
<artifactId>versions-maven-plugin</artifactId>
264-
<version>2.18.0</version>
264+
<version>2.19.1</version>
265265
</plugin>
266266
<plugin>
267267
<groupId>io.smallrye</groupId>
268268
<artifactId>jandex-maven-plugin</artifactId>
269-
<version>3.4.0</version>
269+
<version>3.5.2</version>
270270
</plugin>
271271
<plugin>
272272
<groupId>org.sonatype.central</groupId>
273273
<artifactId>central-publishing-maven-plugin</artifactId>
274-
<version>0.8.0</version>
274+
<version>0.9.0</version>
275275
<extensions>true</extensions>
276276
<configuration>
277277
<publishingServerId>central.sonatype.com</publishingServerId>

src/main/java/org/microbean/construct/Domain.java

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
import static javax.lang.model.element.ElementKind.CONSTRUCTOR;
6060
import static javax.lang.model.element.ElementKind.METHOD;
6161

62+
import static javax.lang.model.type.TypeKind.DECLARED;
63+
6264
/**
6365
* A representation of a domain of valid Java constructs.
6466
*
@@ -82,6 +84,8 @@
8284
* <p>{@link Domain} implementations must be thread-safe.</p>
8385
*
8486
* @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a>
87+
*
88+
* @see <a href="https://bugs.openjdk.org/browse/JDK-8055219">JDK-8055219</a>
8589
*/
8690
@SuppressWarnings("try")
8791
public interface Domain {
@@ -646,7 +650,7 @@ public default boolean javaLangObject(final TypeMirror t) {
646650
default -> {
647651
try (var lock = this.lock()) {
648652
yield
649-
t.getKind() == TypeKind.DECLARED &&
653+
t.getKind() == DECLARED &&
650654
javaLangObject(((DeclaredType)t).asElement());
651655
}
652656
}
@@ -839,7 +843,7 @@ public default boolean parameterized(final TypeMirror t) {
839843
case UniversalType ut -> ut.parameterized();
840844
default -> {
841845
try (var lock = this.lock()) {
842-
yield t.getKind() == TypeKind.DECLARED && !((DeclaredType)t).getTypeArguments().isEmpty();
846+
yield t.getKind() == DECLARED && !((DeclaredType)t).getTypeArguments().isEmpty();
843847
}
844848
}
845849
};
@@ -957,6 +961,35 @@ public default PrimitiveType primitiveType(final TypeElement e) {
957961
// (Unboxing.)
958962
public PrimitiveType primitiveType(final TypeMirror t);
959963

964+
/**
965+
* A convenience method that returns {@code true} if and only if the supplied {@link TypeMirror} represents a
966+
* <dfn>prototypical type</dfn>.
967+
*
968+
* <p>Prototypical types are not defined by the Java Language Specification. They are partially defined by the
969+
* {@linkplain TypeElement#asType() specification of the <code>TypeElement#asType()</code>
970+
* method}.</p>
971+
*
972+
* @param t a {@link TypeMirror}; must not be {@code null}
973+
*
974+
* @return {@code true} if and only if this {@link UniversalType} represents a <dfn>prototypical type</dfn>
975+
*
976+
* @exception NullPointerException if {@code t} is {@code null}
977+
*
978+
* @see TypeElement#asType()
979+
*/
980+
// (Convenience.)
981+
public default boolean prototypical(final TypeMirror t) {
982+
return switch (t) {
983+
case null -> throw new NullPointerException("t");
984+
case UniversalType ut -> ut.prototypical();
985+
default -> {
986+
try (var lock = this.lock()) {
987+
yield t.getKind() == DECLARED && t.equals(((DeclaredType)t).asElement().asType());
988+
}
989+
}
990+
};
991+
}
992+
960993
/**
961994
* A convenience method that returns {@code true} if and only if the supplied {@link TypeMirror} is a <dfn>raw
962995
* type</dfn> according to <a href="https://docs.oracle.com/javase/specs/jls/se23/html/jls-4.html#jls-4.8">the rules
@@ -1064,6 +1097,8 @@ yield switch (t.getKind()) {
10641097
*
10651098
* @see javax.lang.model.util.Types#isSameType(TypeMirror, TypeMirror)
10661099
*
1100+
* @see <a href="https://bugs.openjdk.org/browse/JDK-8055219">JDK-8055219</a>
1101+
*
10671102
* @spec https://docs.oracle.com/javase/specs/jls/se23/html/jls-4.html#jls-4.3.4 Java Language Specification, section
10681103
* 4.3.4
10691104
*

src/main/java/org/microbean/construct/Processor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ final class Processor implements AutoCloseable, javax.annotation.processing.Proc
4646

4747
private final Consumer<? super ProcessingEnvironment> cpe;
4848

49+
// run() method invoked under lock
4950
private final Runnable r;
5051

5152
private final Lock lock;

0 commit comments

Comments
 (0)