From 37ae7378da3a9771b046276e37952e31abc6564a Mon Sep 17 00:00:00 2001 From: Urs Joss Date: Sat, 7 Oct 2023 16:47:08 +0200 Subject: [PATCH] fix!: [#132] remove deprecated RIS fields number and typeOfWork --- CHANGELOG.adoc | 1 + subprojects/kris-core/api/kris-core.api | 18 ++-- .../kotlin/ch/difty/kris/domain/RisRecord.kt | 22 ----- .../kotlin/ch/difty/kris/domain/RisTag.kt | 23 +---- .../kris/domain/RisRecordBuilderTest.java | 40 --------- .../ch/difty/kris/usage/KRisUsageTest.java | 2 +- .../ch/difty/kris/KRisProcessingSpec.kt | 2 +- .../ch/difty/kris/domain/RisRecordSpec.kt | 35 -------- .../kotlin/ch/difty/kris/domain/RisTagTest.kt | 1 - .../ch/difty/kris/usage/KRisUsageSpec.kt | 88 +------------------ .../difty/kris/usage/KRisIoUsageExportSpec.kt | 1 - .../difty/kris/usage/KRisIoUsageImportSpec.kt | 1 - .../ch/difty/kris/usage/KRisIoUsageSpec.kt | 1 - 13 files changed, 13 insertions(+), 222 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 67e2f3a7..81745c8a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -77,6 +77,7 @@ The format is based on https://keepachangelog.com/en/1.0.0/[Keep a Changelog]. .Removed - Java 11 compatibility (now requiring java platform 17 as minimum) +- {url-issues}132[#132] Remove deprecated RIS fields number and typeOfWork [[v0.4.9]] diff --git a/subprojects/kris-core/api/kris-core.api b/subprojects/kris-core/api/kris-core.api index e5f0cc55..c326f60d 100644 --- a/subprojects/kris-core/api/kris-core.api +++ b/subprojects/kris-core/api/kris-core.api @@ -36,8 +36,8 @@ public final class ch/difty/kris/KRisExtensionsKt { public final class ch/difty/kris/domain/RisRecord { public fun ()V - public fun (Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V - public synthetic fun (Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Lch/difty/kris/domain/RisType; public final fun component10 ()Ljava/lang/String; public final fun component11 ()Ljava/lang/String; @@ -80,7 +80,7 @@ public final class ch/difty/kris/domain/RisRecord { public final fun component45 ()Ljava/lang/String; public final fun component46 ()Ljava/lang/String; public final fun component47 ()Ljava/lang/String; - public final fun component48 ()Ljava/lang/Long; + public final fun component48 ()Ljava/lang/String; public final fun component49 ()Ljava/lang/String; public final fun component5 ()Ljava/util/List; public final fun component50 ()Ljava/lang/String; @@ -116,11 +116,9 @@ public final class ch/difty/kris/domain/RisRecord { public final fun component78 ()Ljava/lang/String; public final fun component79 ()Ljava/lang/String; public final fun component8 ()Ljava/lang/String; - public final fun component80 ()Ljava/lang/String; - public final fun component81 ()Ljava/lang/String; public final fun component9 ()Ljava/lang/String; - public final fun copy (Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lch/difty/kris/domain/RisRecord; - public static synthetic fun copy$default (Lch/difty/kris/domain/RisRecord;Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIILjava/lang/Object;)Lch/difty/kris/domain/RisRecord; + public final fun copy (Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lch/difty/kris/domain/RisRecord; + public static synthetic fun copy$default (Lch/difty/kris/domain/RisRecord;Lch/difty/kris/domain/RisType;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIILjava/lang/Object;)Lch/difty/kris/domain/RisRecord; public fun equals (Ljava/lang/Object;)Z public final fun getAbstr ()Ljava/lang/String; public final fun getAbstr2 ()Ljava/lang/String; @@ -161,7 +159,6 @@ public final class ch/difty/kris/domain/RisRecord { public final fun getMiscellaneous2 ()Ljava/lang/String; public final fun getMiscellaneous3 ()Ljava/lang/String; public final fun getNotes ()Ljava/lang/String; - public final fun getNumber ()Ljava/lang/Long; public final fun getNumberOfVolumes ()Ljava/lang/String; public final fun getOriginalPublication ()Ljava/lang/String; public final fun getPdfLinks ()Ljava/util/List; @@ -193,7 +190,6 @@ public final class ch/difty/kris/domain/RisRecord { public final fun getTranslatedAuthor ()Ljava/lang/String; public final fun getTranslatedTitle ()Ljava/lang/String; public final fun getType ()Lch/difty/kris/domain/RisType; - public final fun getTypeOfWork ()Ljava/lang/String; public final fun getUnpublishedReferenceTitle ()Ljava/lang/String; public final fun getUrl ()Ljava/lang/String; public final fun getUserDefinable1 ()Ljava/lang/String; @@ -238,7 +234,6 @@ public final class ch/difty/kris/domain/RisRecord { public final fun setMiscellaneous2 (Ljava/lang/String;)V public final fun setMiscellaneous3 (Ljava/lang/String;)V public final fun setNotes (Ljava/lang/String;)V - public final fun setNumber (Ljava/lang/Long;)V public final fun setNumberOfVolumes (Ljava/lang/String;)V public final fun setOriginalPublication (Ljava/lang/String;)V public final fun setPeriodicalNameFullFormatJF (Ljava/lang/String;)V @@ -265,7 +260,6 @@ public final class ch/difty/kris/domain/RisRecord { public final fun setTranslatedAuthor (Ljava/lang/String;)V public final fun setTranslatedTitle (Ljava/lang/String;)V public final fun setType (Lch/difty/kris/domain/RisType;)V - public final fun setTypeOfWork (Ljava/lang/String;)V public final fun setUnpublishedReferenceTitle (Ljava/lang/String;)V public final fun setUrl (Ljava/lang/String;)V public final fun setUserDefinable1 (Ljava/lang/String;)V @@ -320,7 +314,6 @@ public final class ch/difty/kris/domain/RisRecord$Builder { public final fun miscellaneous2 (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun miscellaneous3 (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun notes (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; - public final fun number (Ljava/lang/Long;)Lch/difty/kris/domain/RisRecord$Builder; public final fun numberOfVolumes (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun originalPublication (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun pdfLinks (Ljava/util/List;)Lch/difty/kris/domain/RisRecord$Builder; @@ -352,7 +345,6 @@ public final class ch/difty/kris/domain/RisRecord$Builder { public final fun translatedAuthor (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun translatedTitle (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun type (Lch/difty/kris/domain/RisType;)Lch/difty/kris/domain/RisRecord$Builder; - public final fun typeOfWork (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun unpublishedReferenceTitle (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun url (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; public final fun userDefinable1 (Ljava/lang/String;)Lch/difty/kris/domain/RisRecord$Builder; diff --git a/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisRecord.kt b/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisRecord.kt index 410871b5..6ec10c30 100644 --- a/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisRecord.kt +++ b/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisRecord.kt @@ -171,11 +171,6 @@ public data class RisRecord( /** M1. Often used for Number. This is an alphanumeric field, thus suporting e.g. ranges or chars */ public var miscellaneous1: String? = null, - // TODO remove in #132 - /** M1 - deprecated */ - @Deprecated("Use miscellaneous1 (returning a nullable String) instead", ReplaceWith("miscellaneous1")) - public var number: Long? = null, - /** * M2. This is an alphanumeric field and there is no practical limit to the length of this field. */ @@ -186,11 +181,6 @@ public data class RisRecord( */ public var miscellaneous3: String? = null, - // TODO remove in #132 - /** M3 - deprecated */ - @Deprecated("Use miscellaneous3 instead", ReplaceWith("miscellaneous3")) - public var typeOfWork: String? = null, - /** N1 */ public var notes: String? = null, @@ -348,12 +338,8 @@ public data class RisRecord( private var label: String? = null private var websiteLink: String? = null private var miscellaneous1: String? = null - // TODO remove in #132 - private var number: Long? = null private var miscellaneous2: String? = null private var miscellaneous3: String? = null - // TODO remove in #132 - private var typeOfWork: String? = null private var notes: String? = null private var abstr2: String? = null private var numberOfVolumes: String? = null @@ -473,14 +459,8 @@ public data class RisRecord( public fun label(label: String?): Builder = apply { this.label = label } public fun websiteLink(websiteLink: String?): Builder = apply { this.websiteLink = websiteLink } public fun miscellaneous1(miscellaneous1: String?): Builder = apply { this.miscellaneous1 = miscellaneous1 } - - @Deprecated("use miscellaneous1(number.toString()) instead", ReplaceWith("miscellaneous1(number.toString())")) - public fun number(number: Long?): Builder = apply { this.number = number } public fun miscellaneous2(miscellaneous2: String?): Builder = apply { this.miscellaneous2 = miscellaneous2 } public fun miscellaneous3(miscellaneous3: String?): Builder = apply { this.miscellaneous3 = miscellaneous3 } - - @Deprecated("use miscellaneous3(String) instead", ReplaceWith("miscellaneous3(typeOfWork)")) - public fun typeOfWork(typeOfWork: String?): Builder = apply { this.typeOfWork = typeOfWork } public fun notes(notes: String?): Builder = apply { this.notes = notes } public fun abstr2(abstr2: String?): Builder = apply { this.abstr2 = abstr2 } public fun numberOfVolumes(numberOfVolumes: String?): Builder = apply { this.numberOfVolumes = numberOfVolumes } @@ -568,10 +548,8 @@ public data class RisRecord( label, websiteLink, miscellaneous1, - number, miscellaneous2, miscellaneous3, - typeOfWork, notes, abstr2, numberOfVolumes, diff --git a/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisTag.kt b/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisTag.kt index a523b744..d7dbb512 100644 --- a/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisTag.kt +++ b/subprojects/kris-core/src/main/kotlin/ch/difty/kris/domain/RisTag.kt @@ -17,7 +17,6 @@ import kotlin.reflect.KClass * The class was composed from information available on * [Wikipedia](https://en.wikipedia.org/wiki/RIS_(file_format)). */ -@Suppress("SpellCheckingInspection") public enum class RisTag( internal val description: String, internal val maxLength: Int? = null, @@ -382,17 +381,10 @@ public enum class RisTag( ), /** Miscellaneous 1. Often used for Number or Range of Numbers */ - @Suppress("Deprecation") M1( description = "Miscellaneous 1 (often Number)", - setInto = { r, v -> - r.miscellaneous1 = v as String? - r.number = v?.toLongOrNull() - }, - getFrom = { r: RisRecord -> - r.miscellaneous1.takeUnless { it.isNullOrBlank() } - ?: r.number - }, + setInto = { r, v -> r.miscellaneous1 = v as String? }, + getFrom = { r: RisRecord -> r.miscellaneous1 }, kClass = String::class ), @@ -404,17 +396,10 @@ public enum class RisTag( ), /** Miscellaneous 3. Often used for Type of Work */ - @Suppress("Deprecation") M3( description = "Miscellaneous 3 (often Type of Work)", - setInto = { r, v -> - r.miscellaneous3 = v as String? - r.typeOfWork = v - }, - getFrom = { r: RisRecord -> - r.miscellaneous3.takeUnless { it.isNullOrBlank() } - ?: r.typeOfWork - } + setInto = { r, v -> r.miscellaneous3 = v as String? }, + getFrom = { r: RisRecord -> r.miscellaneous3 } ), /** Notes */ diff --git a/subprojects/kris-core/src/test/java/ch/difty/kris/domain/RisRecordBuilderTest.java b/subprojects/kris-core/src/test/java/ch/difty/kris/domain/RisRecordBuilderTest.java index 4148aecd..012488a2 100644 --- a/subprojects/kris-core/src/test/java/ch/difty/kris/domain/RisRecordBuilderTest.java +++ b/subprojects/kris-core/src/test/java/ch/difty/kris/domain/RisRecordBuilderTest.java @@ -256,44 +256,4 @@ void emptyRecord() { assertThat(risRecord.getPrimaryDate()).isNull(); assertThat(risRecord.getAccessDate()).isNull(); } - - @SuppressWarnings("deprecation") - @Test - public void givenRisRecordWithMisc1_providesMisc1ButNotNumber() { - RisRecord risRecord = new RisRecord.Builder() - .miscellaneous1("4es") - .build(); - assertThat(risRecord.getMiscellaneous1()).isEqualTo("4es"); - assertThat(risRecord.getNumber()).isNull(); - } - - @SuppressWarnings("deprecation") - @Test - public void givenRisRecordWithNumber_providesNumberButNotMisc1() { - RisRecord risRecord = new RisRecord.Builder() - .number(1234L) - .build(); - assertThat(risRecord.getMiscellaneous1()).isNull(); - assertThat(risRecord.getNumber()).isEqualTo(1234L); - } - - @SuppressWarnings("deprecation") - @Test - public void givenRisRecordWithMisc3_providesMisc3ButNotTypeOfWork() { - RisRecord risRecord = new RisRecord.Builder() - .miscellaneous3("misc3") - .build(); - assertThat(risRecord.getMiscellaneous3()).isEqualTo("misc3"); - assertThat(risRecord.getTypeOfWork()).isNull(); - } - - @SuppressWarnings("deprecation") - @Test - public void givenRisRecordWithTypeOfWork_providesTypeOfWorkButNotMisc3() { - RisRecord risRecord = new RisRecord.Builder() - .typeOfWork("misc3") - .build(); - assertThat(risRecord.getMiscellaneous3()).isNull(); - assertThat(risRecord.getTypeOfWork()).isEqualTo("misc3"); - } } diff --git a/subprojects/kris-core/src/test/java/ch/difty/kris/usage/KRisUsageTest.java b/subprojects/kris-core/src/test/java/ch/difty/kris/usage/KRisUsageTest.java index b4e37a88..743a8df4 100644 --- a/subprojects/kris-core/src/test/java/ch/difty/kris/usage/KRisUsageTest.java +++ b/subprojects/kris-core/src/test/java/ch/difty/kris/usage/KRisUsageTest.java @@ -18,7 +18,7 @@ class KRisUsageTest { //@formatter:off - @SuppressWarnings("SpellCheckingInspection") private final List risLines = List.of( + private final List risLines = List.of( "TY - JOUR", "AU - Shannon, Claude E.", "PY - 1948/07//", diff --git a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/KRisProcessingSpec.kt b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/KRisProcessingSpec.kt index bf356732..0b6c28a9 100644 --- a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/KRisProcessingSpec.kt +++ b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/KRisProcessingSpec.kt @@ -10,7 +10,7 @@ import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldHaveSize import org.amshove.kluent.shouldThrow -@Suppress("unused", "SpellCheckingInspection", "S1192") +@Suppress("SpellCheckingInspection", "S1192") object KRisProcessingSpec : DescribeSpec({ describe("with RIS file as list of strings") { diff --git a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisRecordSpec.kt b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisRecordSpec.kt index 49211c2e..c3c05b22 100644 --- a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisRecordSpec.kt +++ b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisRecordSpec.kt @@ -9,7 +9,6 @@ import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldBeNull import org.amshove.kluent.shouldContainAll -@Suppress("unused") object RisRecordSpec : DescribeSpec({ describe("no values specified") { @@ -281,40 +280,6 @@ object RisRecordSpec : DescribeSpec({ assertSpecifiedValues(record) } } - - @Suppress("DEPRECATION") - describe("Deprecated fields") { - describe("with RisRecord constructed with new properties") { - val record = RisRecord(miscellaneous1 = "1234", miscellaneous3 = "foo") - it("should return null as Number") { - record.number.shouldBeNull() - } - it("should return null as typeOfWork") { - record.typeOfWork.shouldBeNull() - } - it("should return '1234' as miscellaneous1") { - record.miscellaneous1 shouldBeEqualTo "1234" - } - it("should return 'foo'' as miscellaneous3") { - record.miscellaneous3 shouldBeEqualTo "foo" - } - } - describe("with RisRecord constructed with deprecated properties") { - val record = RisRecord(number = 1234L, typeOfWork = "foo") - it("should return 1234 as Number") { - record.number shouldBeEqualTo 1234L - } - it("should return 'foo' as typeOfWork") { - record.typeOfWork shouldBeEqualTo "foo" - } - it("should return null as miscellaneous1") { - record.miscellaneous1.shouldBeNull() - } - it("should return null as miscellaneous3") { - record.miscellaneous3.shouldBeNull() - } - } - } }) @Suppress("LongMethod") diff --git a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisTagTest.kt b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisTagTest.kt index adc32751..49aea007 100644 --- a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisTagTest.kt +++ b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/domain/RisTagTest.kt @@ -3,7 +3,6 @@ package ch.difty.kris.domain import org.amshove.kluent.shouldContainAll import org.junit.jupiter.api.Test -@Suppress("SpellCheckingInspection") internal class RisTagTest { @Test diff --git a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/usage/KRisUsageSpec.kt b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/usage/KRisUsageSpec.kt index e0e041ca..d5097786 100644 --- a/subprojects/kris-core/src/test/kotlin/ch/difty/kris/usage/KRisUsageSpec.kt +++ b/subprojects/kris-core/src/test/kotlin/ch/difty/kris/usage/KRisUsageSpec.kt @@ -12,13 +12,9 @@ import kotlinx.coroutines.flow.asFlow import kotlinx.coroutines.flow.toList import kotlinx.coroutines.runBlocking import org.amshove.kluent.shouldBeEqualTo -import org.amshove.kluent.shouldBeNull import org.amshove.kluent.shouldHaveSize -/** - * Specification how to use KRis from kotlin - */ -@Suppress("SpellCheckingInspection", "unused") +/** Specification how to use KRis from kotlin */ object KRisUsageSpec : DescribeSpec({ describe("with list of strings representing two RIS records") { @@ -159,86 +155,4 @@ object KRisUsageSpec : DescribeSpec({ KRis.risTagNames() shouldBeEqualTo risTagNames } } - - @Suppress("DEPRECATION") - describe("deprecated RisRecord Properties") { - describe("importing from RIS") { - describe("given M1 with numeric value") { - val risLines: List = listOf( - "M1 - 1234", - "ER - " - ) - it("can be processed") { - val risRecords = risLines.toRisRecords() - risRecords.shouldHaveSize(1) - } - it("can retrieve it with new property miscellaneous1") { - val risRecords = risLines.toRisRecords() - risRecords.first().miscellaneous1 shouldBeEqualTo "1234" - } - it("can retrieve it with deprecated property number") { - val risRecords = risLines.toRisRecords() - risRecords.first().number shouldBeEqualTo 1234L - } - } - describe("given M1 with non-numeric value") { - val risLines: List = listOf( - "M1 - 1234-5678", - "ER - " - ) - it("can be processed") { - val risRecords = risLines.toRisRecords() - risRecords.shouldHaveSize(1) - } - it("can retrieve it with new property miscellaneous1") { - val risRecords = risLines.toRisRecords() - risRecords.first().miscellaneous1 shouldBeEqualTo "1234-5678" - } - it("can retrieve null with deprecated property number") { - val risRecords = risLines.toRisRecords() - risRecords.first().number.shouldBeNull() - } - } - describe("given M3") { - val risLines: List = listOf( - "M3 - typeOfWork", - "ER - " - ) - it("can be processed") { - val risRecords = risLines.toRisRecords() - risRecords.shouldHaveSize(1) - } - it("can retrieve it with new property miscellaneous3") { - val risRecords = risLines.toRisRecords() - risRecords.first().miscellaneous3 shouldBeEqualTo "typeOfWork" - } - it("can retrieve it with deprecated property typeOfWork") { - val risRecords = risLines.toRisRecords() - risRecords.first().typeOfWork shouldBeEqualTo "typeOfWork" - } - } - } - describe("exporting to RIS") { - describe("using new properties miscellaneous1 and miscellaneous 3") { - val risRecord1 = RisRecord( - miscellaneous1 = "1234-5678", - miscellaneous3 = "typeOfWork", - ) - val risRecord2 = RisRecord( - number = 4567L, - typeOfWork = "tow", - ) - it("should export both to M1 and M3") { - listOf(risRecord1, risRecord2).toRisLines().joinToString(separator = "") shouldBeEqualTo """M1 - 1234-5678 - |M3 - typeOfWork - |ER - - | - |M1 - 4567 - |M3 - tow - |ER - - |""".trimMargin() - } - } - } - } }) diff --git a/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageExportSpec.kt b/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageExportSpec.kt index e0aaeaf4..54d39c00 100644 --- a/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageExportSpec.kt +++ b/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageExportSpec.kt @@ -10,7 +10,6 @@ import kotlinx.coroutines.withContext import org.amshove.kluent.shouldHaveSize import java.io.File -@Suppress("unused") object KRisIoUsageExportSpec : DescribeSpec({ describe("exporting into file") { diff --git a/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageImportSpec.kt b/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageImportSpec.kt index 6ea35bbc..d5349e5a 100644 --- a/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageImportSpec.kt +++ b/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageImportSpec.kt @@ -12,7 +12,6 @@ import org.amshove.kluent.shouldHaveSize import java.io.File import kotlin.streams.toList -@Suppress("unused") object KRisIoUsageImportSpec : DescribeSpec({ describe("importing from file") { diff --git a/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageSpec.kt b/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageSpec.kt index 939e1f84..20b5f140 100644 --- a/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageSpec.kt +++ b/subprojects/kris-io/src/integrationTest/kotlin/ch/difty/kris/usage/KRisIoUsageSpec.kt @@ -12,7 +12,6 @@ import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldHaveSize import java.io.File -@Suppress("unused") object KRisIoUsageSpec : DescribeSpec({ describe("importing from file") {