Skip to content

Commit

Permalink
fix(jans-auth-server): fixed equals/hashcode by removing redundant dn…
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Mar 17, 2022
1 parent 3f58aff commit d27659d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.jans.orm.annotation.AttributeName;
import io.jans.orm.annotation.AttributesList;
import io.jans.orm.annotation.CustomObjectClass;
import io.jans.orm.annotation.DN;
import io.jans.orm.annotation.DataEntry;
import io.jans.orm.annotation.Expiration;
import io.jans.orm.annotation.JsonObject;
Expand All @@ -42,10 +41,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Client extends DeletableEntity implements Serializable {

private static final long serialVersionUID = -6832496019942067970L;

@DN
private String dn;
private static final long serialVersionUID = -6832496019942067971L;

@JsonProperty("inum")
@AttributeName(name = "inum", ignoreDuringUpdate = true)
Expand Down Expand Up @@ -196,7 +192,7 @@ public class Client extends DeletableEntity implements Serializable {
private Integer accessTokenLifetime;

@AttributesList(name = "name", value = "values", sortByName = true)
private List<CustomAttribute> customAttributes = new ArrayList<CustomAttribute>();
private List<CustomAttribute> customAttributes = new ArrayList<>();

@CustomObjectClass
private String[] customObjectClasses;
Expand Down Expand Up @@ -291,14 +287,6 @@ public AuthenticationMethod getAuthenticationMethod() {
return AuthenticationMethod.fromString(tokenEndpointAuthMethod);
}

public String getDn() {
return dn;
}

public void setDn(String dn) {
this.dn = dn;
}

/**
* Gets logout session required.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.jans.as.persistence.model;

import io.jans.orm.annotation.AttributeName;
import io.jans.orm.annotation.DN;
import io.jans.orm.annotation.DataEntry;
import io.jans.orm.annotation.Expiration;
import io.jans.orm.annotation.JsonObject;
Expand All @@ -22,9 +21,6 @@ public class Par extends DeletableEntity implements Serializable {

private static final long serialVersionUID = -3332496019942067971L;

@DN
private String dn;

@AttributeName(name = "jansId", consistency = true)
private String id;

Expand Down Expand Up @@ -57,16 +53,6 @@ public boolean isExpired(Date now) {
return exp == null || exp.before(now);
}

@Override
public String getDn() {
return dn;
}

@Override
public void setDn(String dn) {
this.dn = dn;
}

public String getId() {
return id;
}
Expand All @@ -86,7 +72,7 @@ public void setTtl(Integer ttl) {
@Override
public String toString() {
return "Par{" +
"dn='" + dn + '\'' +
"dn='" + getDn() + '\'' +
", id='" + id + '\'' +
", attributes=" + attributes +
"} " + super.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class Scope extends DeletableEntity implements Serializable {

private static final long serialVersionUID = 4308826784917052508L;

@DN
private String dn;
@AttributeName(ignoreDuringUpdate = true)
private String inum;

Expand Down Expand Up @@ -77,14 +75,6 @@ public void setAttributes(ScopeAttributes attributes) {
this.attributes = attributes;
}

public String getDn() {
return dn;
}

public void setDn(String dn) {
this.dn = dn;
}

public String getInum() {
return this.inum;
}
Expand Down Expand Up @@ -188,7 +178,7 @@ public boolean isUmaType() {
@Override
public String toString() {
return "Scope{" +
"dn='" + dn + '\'' +
"dn='" + getDn() + '\'' +
", inum='" + inum + '\'' +
", displayName='" + displayName + '\'' +
", id='" + id + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
@ObjectClass(value = "jansCache")
public class NativePersistenceCacheEntity extends DeletableEntity implements Serializable, Deletable {

@DN
private String dn;
@Expiration
private Integer ttl;
@AttributeName(name = "uuid")
Expand All @@ -28,14 +26,6 @@ public class NativePersistenceCacheEntity extends DeletableEntity implements Ser
@AttributeName(name = "dat")
private String data;

public String getDn() {
return dn;
}

public void setDn(String dn) {
this.dn = dn;
}

public Integer getTtl() {
return ttl;
}
Expand Down Expand Up @@ -70,7 +60,7 @@ public void setData(String data) {

@Override
public String toString() {
return "NativePersistenceCacheEntity [dn=" + dn + ", ttl=" + ttl + ", id=" + id + ", creationDate=" + creationDate + ", data="
return "NativePersistenceCacheEntity [dn=" + getDn() + ", ttl=" + ttl + ", id=" + id + ", creationDate=" + creationDate + ", data="
+ data + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Copyright (c) 2020, Janssen Project
*/
import io.jans.orm.annotation.AttributeName;
import io.jans.orm.annotation.DN;
import io.jans.orm.annotation.DataEntry;
import io.jans.orm.annotation.Expiration;
import io.jans.orm.annotation.ObjectClass;
Expand All @@ -22,8 +21,6 @@ public class SimpleCacheEntry extends DeletableEntity implements Serializable, D

private static final long serialVersionUID = 3360900373193184522L;

@DN
private String dn;
@Expiration
private Integer ttl;
@AttributeName(name = "uuid")
Expand All @@ -33,14 +30,6 @@ public class SimpleCacheEntry extends DeletableEntity implements Serializable, D
@AttributeName(name = "dat")
private String data;

public String getDn() {
return dn;
}

public void setDn(String dn) {
this.dn = dn;
}

public Integer getTtl() {
return ttl;
}
Expand Down Expand Up @@ -75,7 +64,7 @@ public void setData(String data) {

@Override
public String toString() {
return "NativePersistenceCacheEntity [dn=" + dn + ", ttl=" + ttl + ", id=" + id + ", creationDate=" + creationDate + ", data="
return "NativePersistenceCacheEntity [dn=" + getDn() + ", ttl=" + ttl + ", id=" + id + ", creationDate=" + creationDate + ", data="
+ data + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Copyright (c) 2020, Janssen Project
*/
import io.jans.orm.annotation.AttributeName;
import io.jans.orm.annotation.DN;
import io.jans.orm.annotation.DataEntry;
import io.jans.orm.annotation.Expiration;
import io.jans.orm.annotation.ObjectClass;
Expand All @@ -22,8 +21,6 @@ public class SimpleCacheEntry extends DeletableEntity implements Serializable, D

private static final long serialVersionUID = 3360900373193184522L;

@DN
private String dn;
@Expiration
private Integer ttl;
@AttributeName(name = "uuid")
Expand All @@ -33,14 +30,6 @@ public class SimpleCacheEntry extends DeletableEntity implements Serializable, D
@AttributeName(name = "dat")
private String data;

public String getDn() {
return dn;
}

public void setDn(String dn) {
this.dn = dn;
}

public Integer getTtl() {
return ttl;
}
Expand Down Expand Up @@ -75,7 +64,7 @@ public void setData(String data) {

@Override
public String toString() {
return "NativePersistenceCacheEntity [dn=" + dn + ", ttl=" + ttl + ", id=" + id + ", creationDate=" + creationDate + ", data="
return "NativePersistenceCacheEntity [dn=" + getDn() + ", ttl=" + ttl + ", id=" + id + ", creationDate=" + creationDate + ", data="
+ data + "]";
}
}

0 comments on commit d27659d

Please sign in to comment.