From 6f035e8e691e7c83721ab87bdf0a593c582a5d0b Mon Sep 17 00:00:00 2001 From: Anton Kurako Date: Sun, 27 Dec 2020 00:00:03 +0700 Subject: [PATCH 1/2] [1.1.0-SNAPSHOT] Dev ver up --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 459d906..4f931b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ groupId=com.github.goodforgod artifactId=dummymapper -artifactVersion=1.0.1 +artifactVersion=1.1.0-SNAPSHOT ##### GRADLE ##### From f00faba708b6d59c0519781eec795911c78fdfdb Mon Sep 17 00:00:00 2001 From: Anton Kurako Date: Sat, 9 Jan 2021 13:44:28 +0300 Subject: [PATCH 2/2] [1.0.2] Compatibility with IDEA 2020.3+ AvroJacksonMapper required by default fixed --- build.gradle | 2 +- gradle.properties | 2 +- .../java/io/goodforgod/dummymapper/mapper/IMapper.java | 3 +-- .../dummymapper/mapper/impl/AvroJacksonMapper.java | 7 +++---- src/main/resources/META-INF/plugin.xml | 8 +++----- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 7d3d5dd..c2f7dc2 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ targetCompatibility = 1.8 intellij { plugins 'java' - version '2020.2' + version '2020.3' downloadSources = false } diff --git a/gradle.properties b/gradle.properties index 4f931b1..7b8fb32 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ groupId=com.github.goodforgod artifactId=dummymapper -artifactVersion=1.1.0-SNAPSHOT +artifactVersion=1.0.2 ##### GRADLE ##### diff --git a/src/main/java/io/goodforgod/dummymapper/mapper/IMapper.java b/src/main/java/io/goodforgod/dummymapper/mapper/IMapper.java index 611c7ad..3434366 100644 --- a/src/main/java/io/goodforgod/dummymapper/mapper/IMapper.java +++ b/src/main/java/io/goodforgod/dummymapper/mapper/IMapper.java @@ -4,7 +4,6 @@ import io.goodforgod.dummymapper.marker.RawMarker; import io.goodforgod.dummymapper.ui.config.IConfig; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Map contract to map instance of {@link PsiJavaFile} to format as string value @@ -26,5 +25,5 @@ default String map(@NotNull RawMarker marker) { * @throws io.goodforgod.dummymapper.error.MapperException in case of map exception */ @NotNull - String map(@NotNull RawMarker marker, @Nullable T config); + String map(@NotNull RawMarker marker, T config); } diff --git a/src/main/java/io/goodforgod/dummymapper/mapper/impl/AvroJacksonMapper.java b/src/main/java/io/goodforgod/dummymapper/mapper/impl/AvroJacksonMapper.java index 12ebb49..806cbc6 100644 --- a/src/main/java/io/goodforgod/dummymapper/mapper/impl/AvroJacksonMapper.java +++ b/src/main/java/io/goodforgod/dummymapper/mapper/impl/AvroJacksonMapper.java @@ -19,7 +19,6 @@ import io.goodforgod.dummymapper.ui.config.AvroJacksonConfig; import org.apache.avro.Schema; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.Optional; @@ -36,18 +35,18 @@ public class AvroJacksonMapper implements IMapper { private final IFilter emptyFilter = new EmptyMarkerFilter(); private final IFilter avroFilter = new AvroFilter(); - private final IFilter propertyFilter = new JacksonPropertyFilter(); + private final IFilter requiredFieldFilter = new JacksonPropertyFilter(); private final IFilter annotationFilter = new ExcludeSetterAnnotationFilter(); private final ObjectMapper mapper = new ObjectMapper(new AvroFactory()); @NotNull @Override - public String map(@NotNull RawMarker marker, @Nullable AvroJacksonConfig config) { + public String map(@NotNull RawMarker marker, AvroJacksonConfig config) { try { final RawMarker filtered = Optional.of(marker) .map(avroFilter::filter) .map(annotationFilter::filter) - .map(propertyFilter::filter) + .map(r -> config.isRequiredByDefault() ? requiredFieldFilter.filter(r) : r) .map(emptyFilter::filter) .orElseThrow(() -> new IllegalArgumentException("Not filter present!")); diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index df8d93d..a449283 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -22,12 +22,10 @@ ]]> Features or changes in this release + Features or changes in this release:
    -
  • Fixed AVRO namespace mapping.
  • -
  • Fixed path scanning on OSX.
  • -
  • Fixed java.time.* package serialization in ISO8601 format when mapping to Json.
  • -
  • Compatibility with IDEA 2020.2+
  • +
  • Map as Avro (Jackson) required by default fixed
  • +
  • Compatibility with IDEA 2020.3+
]]>