From 2215ae6aac87386202b1d1769194f71a56485dfe Mon Sep 17 00:00:00 2001 From: Shahzeb Syed Date: Wed, 16 Sep 2026 12:46:35 +0200 Subject: [PATCH] Deprecate person-alias-related API getPersonAlias() on an IDENTIFIED response now always returns null, which is a real NPE risk for client code that doesn't expect it. include-personalias-for-digipost-user is still accepted, but has no effect. Not removed now, to avoid breaking existing client code. --- .../client/representations/Identification.java | 16 ++++++++++++++++ .../representations/IdentificationResult.java | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/no/digipost/api/client/representations/Identification.java b/src/main/java/no/digipost/api/client/representations/Identification.java index e4583899..6de20955 100644 --- a/src/main/java/no/digipost/api/client/representations/Identification.java +++ b/src/main/java/no/digipost/api/client/representations/Identification.java @@ -30,6 +30,10 @@ @XmlRootElement(name = "identification") public class Identification { + /** + * @deprecated no longer has any effect. + */ + @Deprecated @XmlAttribute(name = "include-personalias-for-digipost-user") protected boolean includePersonaliasForDigipostUser; @@ -48,6 +52,10 @@ public Identification(final NameAndAddress nameAndAddress) { this(nameAndAddress, false); } + /** + * @deprecated use {@link #Identification(NameAndAddress)}. + */ + @Deprecated public Identification(final NameAndAddress nameAndAddress, boolean includePersonaliasForDigipostUser) { this.nameAndAddress = nameAndAddress; this.includePersonaliasForDigipostUser = includePersonaliasForDigipostUser; @@ -56,6 +64,10 @@ public Identification(final NameAndAddress nameAndAddress, boolean includePerson public Identification(final DigipostAddress digipostAddress) { this(digipostAddress, false); } + /** + * @deprecated use {@link #Identification(DigipostAddress)}. + */ + @Deprecated public Identification(final DigipostAddress digipostAddress, boolean includePersonaliasForDigipostUser) { this.includePersonaliasForDigipostUser = includePersonaliasForDigipostUser; this.digipostAddress = digipostAddress.asString(); @@ -64,6 +76,10 @@ public Identification(final DigipostAddress digipostAddress, boolean includePers public Identification(final PersonalIdentificationNumber personalIdentificationNumber) { this(personalIdentificationNumber, false); } + /** + * @deprecated use {@link #Identification(PersonalIdentificationNumber)}. + */ + @Deprecated public Identification(final PersonalIdentificationNumber personalIdentificationNumber, boolean includePersonaliasForDigipostUser) { this.includePersonaliasForDigipostUser = includePersonaliasForDigipostUser; this.personalIdentificationNumber = personalIdentificationNumber.asString(); diff --git a/src/main/java/no/digipost/api/client/representations/IdentificationResult.java b/src/main/java/no/digipost/api/client/representations/IdentificationResult.java index 3653b8f5..422b8572 100644 --- a/src/main/java/no/digipost/api/client/representations/IdentificationResult.java +++ b/src/main/java/no/digipost/api/client/representations/IdentificationResult.java @@ -59,6 +59,10 @@ public UnidentifiedReason getUnidentifiedReason() { return unidentifiedReason; } + /** + * @deprecated no longer returned by the API; always {@code null}. + */ + @Deprecated public String getPersonAlias() { return personAlias; }