Skip to content

Commit 127167e

Browse files
committed
Fix #557: add direct use of module-info.java
1 parent c7f91fb commit 127167e

File tree

12 files changed

+117
-38
lines changed

12 files changed

+117
-38
lines changed

avro/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ abstractions.
8686
</execution>
8787
</executions>
8888
</plugin>
89-
<!-- 19-Mar-2019, tatu: Add rudimentary JDK9+ module info. To build with JDK 8
90-
will have to use `moduleInfoFile` as anything else requires JDK 9+
91-
-->
92-
<plugin>
93-
<groupId>org.moditect</groupId>
94-
<artifactId>moditect-maven-plugin</artifactId>
95-
</plugin>
9689
</plugins>
9790
</build>
9891
</project>

avro/src/moditect/module-info.java renamed to avro/src/main/java/module-info.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
module tools.jackson.dataformat.avro {
1+
// Avro Main artifact Module descriptor
2+
module tools.jackson.dataformat.avro
3+
{
24
requires transitive com.fasterxml.jackson.annotation;
35
requires tools.jackson.core;
46
requires tools.jackson.databind;
57

6-
// silly avro Apache impl, its deps:
7-
requires static avro;
8-
requires static jackson.core.asl;
9-
requires static jackson.mapper.asl;
8+
requires org.apache.avro;
109

1110
exports tools.jackson.dataformat.avro;
1211
exports tools.jackson.dataformat.avro.annotation;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Avro unit test Module descriptor
2+
module tools.jackson.dataformat.avro
3+
{
4+
// Since we are not split from Main artifact, will not
5+
// need to depend on Main artifact -- but need its dependencies
6+
7+
requires tools.jackson.core;
8+
requires tools.jackson.databind;
9+
10+
requires org.apache.avro;
11+
12+
// Additional test lib/framework dependencies
13+
requires org.assertj.core;
14+
requires org.junit.jupiter.api;
15+
requires org.junit.jupiter.params;
16+
17+
// Further, need to open up some packages for JUnit et al
18+
19+
opens tools.jackson.dataformat.avro;
20+
opens tools.jackson.dataformat.avro.annotation;
21+
opens tools.jackson.dataformat.avro.dos;
22+
opens tools.jackson.dataformat.avro.fuzz;
23+
opens tools.jackson.dataformat.avro.gen;
24+
opens tools.jackson.dataformat.avro.interop;
25+
opens tools.jackson.dataformat.avro.interop.annotations;
26+
opens tools.jackson.dataformat.avro.interop.arrays;
27+
opens tools.jackson.dataformat.avro.interop.maps;
28+
opens tools.jackson.dataformat.avro.interop.records;
29+
opens tools.jackson.dataformat.avro.jsr310;
30+
opens tools.jackson.dataformat.avro.schema;
31+
opens tools.jackson.dataformat.avro.schemaev;
32+
opens tools.jackson.dataformat.avro.testsupport;
33+
opens tools.jackson.dataformat.avro.testutil.failure;
34+
opens tools.jackson.dataformat.avro.tofix;
35+
}

cbor/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ encoded data using Jackson abstractions (streaming API, data binding, tree model
6464
</execution>
6565
</executions>
6666
</plugin>
67-
<!-- 19-Mar-2019, tatu: Add rudimentary JDK9+ module info. To build with JDK 8
68-
will have to use `moduleInfoFile` as anything else requires JDK 9+
69-
-->
70-
<plugin>
71-
<groupId>org.moditect</groupId>
72-
<artifactId>moditect-maven-plugin</artifactId>
73-
</plugin>
7467
</plugins>
7568
</build>
7669
</project>

cbor/src/moditect/module-info.java renamed to cbor/src/main/java/module-info.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module tools.jackson.dataformat.cbor {
1+
// CBOR Main artifact Module descriptor
2+
module tools.jackson.dataformat.cbor
3+
{
24
requires tools.jackson.core;
35
requires tools.jackson.databind;
46

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// CBOR unit test Module descriptor
2+
module tools.jackson.dataformat.cbor
3+
{
4+
// Since we are not split from Main artifact, will not
5+
// need to depend on Main artifact -- but need its dependencies
6+
7+
requires tools.jackson.core;
8+
requires tools.jackson.databind;
9+
10+
// Additional test lib/framework dependencies
11+
requires org.junit.jupiter.api;
12+
requires org.junit.jupiter.params;
13+
14+
// Further, need to open up some packages for JUnit et al
15+
opens tools.jackson.dataformat.cbor;
16+
opens tools.jackson.dataformat.cbor.constraints;
17+
opens tools.jackson.dataformat.cbor.dos;
18+
opens tools.jackson.dataformat.cbor.filter;
19+
opens tools.jackson.dataformat.cbor.fuzz;
20+
opens tools.jackson.dataformat.cbor.gen;
21+
opens tools.jackson.dataformat.cbor.gen.dos;
22+
opens tools.jackson.dataformat.cbor.mapper;
23+
opens tools.jackson.dataformat.cbor.parse;
24+
opens tools.jackson.dataformat.cbor.seq;
25+
opens tools.jackson.dataformat.cbor.testutil;
26+
opens tools.jackson.dataformat.cbor.testutil.failure;
27+
}

cbor/src/test/java/tools/jackson/dataformat/cbor/parse/SymbolTableTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ public void testSimpleDefault() throws Exception
3636
assertTrue(syms.isCanonicalizing()); // added in 2.13
3737

3838
assertEquals(0, syms.size());
39-
assertEquals(0, _findParent(syms).size());
39+
//assertEquals(0, _findParent(syms).size());
4040

4141
assertToken(JsonToken.START_OBJECT, p.nextToken());
4242
assertToken(JsonToken.PROPERTY_NAME, p.nextToken());
4343
assertEquals("a", p.currentName());
4444
assertEquals(1, syms.size());
4545
// not yet synced to parent
46-
assertEquals(0, _findParent(syms).size());
46+
//assertEquals(0, _findParent(syms).size());
4747

4848
while (p.nextToken() != null) { ; }
4949
assertEquals(2, syms.size());
5050
// but after closing, should sync
51-
assertEquals(2, _findParent(syms).size());
51+
//assertEquals(2, _findParent(syms).size());
5252
}
5353

5454
// by default, should canonicalize etc:
5555
try (JsonParser p = vanillaMapper.createParser(doc)) {
5656
ByteQuadsCanonicalizer syms = _findSymbols(p);
5757
assertEquals(2, syms.size());
5858
// also check that parent (root) has it all?
59-
assertEquals(2, _findParent(syms).size());
59+
//assertEquals(2, _findParent(syms).size());
6060

6161
// but no additions second time around
6262
while (p.nextToken() != null) { ; }
@@ -118,7 +118,7 @@ public void testSimpleNoCanonicalize() throws Exception
118118
assertFalse(syms.isCanonicalizing()); // added in 2.13
119119
assertEquals(-1, syms.size());
120120
// also, should not have parent:
121-
assertNull(_findParent(syms));
121+
//assertNull(_findParent(syms));
122122

123123
assertToken(JsonToken.START_OBJECT, p.nextToken());
124124
assertToken(JsonToken.PROPERTY_NAME, p.nextToken());
@@ -227,10 +227,13 @@ private ByteQuadsCanonicalizer _findSymbols(JsonParser p) throws Exception
227227
return (ByteQuadsCanonicalizer) f.get(p);
228228
}
229229

230+
// Cannot access under JPMS, alas
231+
/*
230232
private ByteQuadsCanonicalizer _findParent(ByteQuadsCanonicalizer sym) throws Exception
231233
{
232234
Field f = ByteQuadsCanonicalizer.class.getDeclaredField("_parent");
233235
f.setAccessible(true);
234236
return (ByteQuadsCanonicalizer) f.get(sym);
235237
}
238+
*/
236239
}

release-notes/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ implementations)
2929
`SmileGenerator.Feature` as `SmileWriteFeature`
3030
#543: (avro) Enable "logical types" support in `AvroSchemaGenerator`
3131
by default (3.0)
32+
#557: Change 3.0 to use `module-info.java` directly [JSTEP-11]
3233
- Minimum Java baseline: Java 17

smile/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ tree model)
8282
</execution>
8383
</executions>
8484
</plugin>
85-
<!-- 19-Mar-2019, tatu: Add rudimentary JDK9+ module info. To build with JDK 8
86-
will have to use `moduleInfoFile` as anything else requires JDK 9+
87-
-->
88-
<plugin>
89-
<groupId>org.moditect</groupId>
90-
<artifactId>moditect-maven-plugin</artifactId>
91-
</plugin>
9285
</plugins>
9386
</build>
9487
</project>

smile/src/moditect/module-info.java renamed to smile/src/main/java/module-info.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module tools.jackson.dataformat.smile {
1+
// Smile Main artifact Module descriptor
2+
module tools.jackson.dataformat.smile
3+
{
24
requires tools.jackson.core;
35
requires tools.jackson.databind;
46

0 commit comments

Comments
 (0)