Skip to content

Fix Repeatable Annotation Name Collision #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 20, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ final class Constants {
static final String JSONB = "io.avaje.jsonb.Jsonb";
static final String JSON = "io.avaje.jsonb.Json";
static final String JSON_IMPORT = "io.avaje.jsonb.Json.Import";
static final String JSON_IMPORT_LIST = "io.avaje.jsonb.Json.Import.List";
static final String JSON_IMPORT_LIST = "io.avaje.jsonb.Json.Import.Imports";
static final String JSON_MIXIN = "io.avaje.jsonb.Json.MixIn";
static final String IOEXCEPTION = "java.io.IOException";
static final String METHODHANDLE = "java.lang.invoke.MethodHandle";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void writeAdaptersForMixInTypes(Set<? extends Element> mixInElements) {

private void writeAdaptersForImportedList(Set<? extends Element> imported) {
imported.stream()
.flatMap(e -> ImportListPrism.getInstanceOn(e).value().stream())
.flatMap(e -> ImportsPrism.getInstanceOn(e).value().stream())
.forEach(this::addImported);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@GeneratePrism(io.avaje.jsonb.CustomAdapter.class)
@GeneratePrism(io.avaje.jsonb.Json.class)
@GeneratePrism(io.avaje.jsonb.Json.Import.class)
@GeneratePrism(value = io.avaje.jsonb.Json.Import.List.class, name = "ImportListPrism")
@GeneratePrism(io.avaje.jsonb.Json.Import.Imports.class)
@GeneratePrism(io.avaje.jsonb.Json.Alias.class)
@GeneratePrism(io.avaje.jsonb.Json.Creator.class)
@GeneratePrism(io.avaje.jsonb.Json.Ignore.class)
Expand Down
6 changes: 3 additions & 3 deletions jsonb/src/main/java/io/avaje/jsonb/Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import io.avaje.jsonb.Json.Import.List;
import io.avaje.jsonb.Json.Import.Imports;

/**
* Marks a type for JSON support.
Expand Down Expand Up @@ -73,7 +73,7 @@
* }</pre>
*/
@Retention(SOURCE)
@Repeatable(List.class)
@Repeatable(Imports.class)
@Target({TYPE, PACKAGE, MODULE})
@interface Import {

Expand All @@ -96,7 +96,7 @@
*/
@Retention(SOURCE)
@Target({TYPE, PACKAGE, MODULE})
@interface List {
@interface Imports {

Import[] value();
}
Expand Down
Loading