Skip to content

Commit

Permalink
removed duplicated code from session class
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Feb 14, 2023
1 parent 769ee8d commit 93bc565
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public PageAdminLTE(PageParameters parameters) {
Validate.notNull(taskManager, "Task manager was not injected.");
Validate.notNull(reportManager, "Report manager was not injected.");

MidPointAuthWebSession.getSession().setClientCustomization();
MidPointAuthWebSession.get().setClientCustomization();

add(new NewWindowNotifyingBehavior());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public long getItemsPerPage() {
return itemsPerPage;
}

MidPointAuthWebSession session = MidPointAuthWebSession.getSession();
MidPointAuthWebSession session = MidPointAuthWebSession.get();
UserProfileStorage userProfile = session.getSessionStorage().getUserProfile();

return userProfile.getPagingSize(tableId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.session.SessionStorage;

import org.apache.wicket.Session;
import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
Expand Down Expand Up @@ -68,10 +69,6 @@ public Roles getRoles() {
return roles;
}

public static MidPointAuthWebSession getSession() {
return (MidPointAuthWebSession) Session.get();
}

@Override
public boolean authenticate(String username, String password) {
return false;
Expand Down Expand Up @@ -112,7 +109,7 @@ public String debugDump(int indent) {
StringBuilder sb = new StringBuilder();
DebugUtil.indentDebugDump(sb, indent);
sb.append("MidPointAuthWebSession\n");
DebugUtil.debugDumpWithLabel(sb, "sessionStorage", sessionStorage, indent+1);
DebugUtil.debugDumpWithLabel(sb, "sessionStorage", sessionStorage, indent + 1);
return sb.toString();
}

Expand Down

0 comments on commit 93bc565

Please sign in to comment.