- // request.setAttribute(CmsSession.class.getName(), cmsSession);
- if (cmsSession != null) {
- CmsSessionId nodeSessionId = new CmsSessionId(cmsSession.getUuid());
- if (subject.getPrivateCredentials(CmsSessionId.class).size() == 0)
- subject.getPrivateCredentials().add(nodeSessionId);
- else {
- UUID storedSessionId = subject.getPrivateCredentials(CmsSessionId.class).iterator().next()
- .getUuid();
- // if (storedSessionId.equals(httpSessionId.getValue()))
- throw new IllegalStateException(
- "Subject already logged with session " + storedSessionId + " (not " + nodeSessionId + ")");
- }
+
+ if (cmsSession == null)// should be dead code (cf. SuppressWarning of the method)
+ throw new IllegalStateException("CMS session cannot be null");
+
+ CmsSessionId nodeSessionId = new CmsSessionId(cmsSession.getUuid());
+ if (subject.getPrivateCredentials(CmsSessionId.class).size() == 0) {
+ subject.getPrivateCredentials().add(nodeSessionId);
+ } else {
+ UUID storedSessionId = subject.getPrivateCredentials(CmsSessionId.class).iterator().next().getUuid();
+ // if (storedSessionId.equals(httpSessionId.getValue()))
+ throw new IllegalStateException(
+ "Subject already logged with session " + storedSessionId + " (not " + nodeSessionId + ")");