From 578ad0d6bc408edf9e6c875156054374f5fd8337 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 22 Mar 2021 18:40:26 +0100 Subject: change to EGIZ codestyle --- .../moa/spss/server/config/IssuerAndSerial.java | 57 ++++++++++++---------- 1 file changed, 30 insertions(+), 27 deletions(-) (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java') diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java index 38a3ae9..03827f2 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.server.config; import java.math.BigInteger; @@ -34,25 +33,25 @@ import iaik.utils.RFC2253NameParserException; /** * A class containing the issuer and serial number of a certificate, which can * be used to uniquely identify the certificate. - * + * * The issuer is contained as an RFC2253 encoded String. - * + * * @author Patrick Peck * @version $Id$ */ public class IssuerAndSerial { /** The issuer distinguished name. */ - private String issuerDN; + private final String issuerDN; /** The certificate serial number. */ - private BigInteger serial; + private final BigInteger serial; /** * Create an IssuerAndSerial object. - * + * * The name of the issuer is converted to RFC2253. If it cannot be parsed, the - * DN contained in the issuer is set. - * + * DN contained in the issuer is set. + * * @param issuer The isser of a certificate. * @param serial The serial number of the certificate. */ @@ -60,28 +59,28 @@ public class IssuerAndSerial { String issuerDN = null; if (issuer instanceof Name) { try { - issuerDN = ((Name)issuer).getRFC2253String(); - } catch (RFC2253NameParserException e) { + issuerDN = ((Name) issuer).getRFC2253String(); + } catch (final RFC2253NameParserException e) { // do nothing } } if (issuerDN == null) { - RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); + final RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); try { - issuerDN = ((Name)parser.parse()).getRFC2253String(); - } catch (RFC2253NameParserException e) { + issuerDN = parser.parse().getRFC2253String(); + } catch (final RFC2253NameParserException e) { issuerDN = issuer.getName(); } } this.serial = serial; this.issuerDN = issuerDN; } - + /** * Create an IssuerAndSerial object. - * + * * @param issuerDN The issuer distinguished name. Should be an RFC2253 name. - * @param serial The serial number of the certificate. + * @param serial The serial number of the certificate. */ public IssuerAndSerial(String issuerDN, BigInteger serial) { this.issuerDN = issuerDN; @@ -90,7 +89,7 @@ public class IssuerAndSerial { /** * Return the issuer DN in RFC2253 format. - * + * * @return The issuer part of this object. */ public String getIssuerDN() { @@ -99,7 +98,7 @@ public class IssuerAndSerial { /** * Return the serial number. - * + * * @return The serial number of this object. */ public BigInteger getSerial() { @@ -108,28 +107,31 @@ public class IssuerAndSerial { /** * Compare this IssuerAndSerial to another object. - * + * * @param other The object to compare this IssuerAndSerial to. * @return true, if other is an - * IssuerAndSerial object and the issuer and - * serial fields are both equal. false otherwise. + * IssuerAndSerial object and the issuer and + * serial fields are both equal. false + * otherwise. * @see java.lang.Object#equals(java.lang.Object) */ + @Override public boolean equals(Object other) { if (other instanceof IssuerAndSerial) { - IssuerAndSerial ias = (IssuerAndSerial) other; + final IssuerAndSerial ias = (IssuerAndSerial) other; return getIssuerDN().equals(ias.getIssuerDN()) - && getSerial().equals(ias.getSerial()); + && getSerial().equals(ias.getSerial()); } return false; } /** * Return the hash code of this IssuerAndSerial. - * + * * @return The hash code of this IssuerAndSerial. * @see java.lang.Object#hashCode() */ + @Override public int hashCode() { return issuerDN.hashCode() ^ serial.hashCode(); } @@ -137,13 +139,14 @@ public class IssuerAndSerial { /** * Return a String representation of this * IssuerAndSerial object. - * + * * @return The String representation. * @see java.lang.Object#toString() */ + @Override public String toString() { - return ("(IssuerAndSerial - Issuer<" + getIssuerDN()) - + ("> Serial<" + serial.toString() + ">)"); + return "(IssuerAndSerial - Issuer<" + getIssuerDN() + + "> Serial<" + serial.toString() + ">)"; } } -- cgit v1.2.3