Commit 8dd957de3d19edd23e4a05151003d6a7c4279f04
1 parent
f8c26579
Exists in
master
Resolvendo a advertência do Sonar: Duplicated lines
Showing
2 changed files
with
2 additions
and
17 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredPermissionInterceptor.java
@@ -48,9 +48,6 @@ import org.slf4j.Logger; | @@ -48,9 +48,6 @@ import org.slf4j.Logger; | ||
48 | import br.gov.frameworkdemoiselle.annotation.Name; | 48 | import br.gov.frameworkdemoiselle.annotation.Name; |
49 | import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; | 49 | import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; |
50 | import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer; | 50 | import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer; |
51 | -import br.gov.frameworkdemoiselle.security.AuthorizationException; | ||
52 | -import br.gov.frameworkdemoiselle.security.RequiredPermission; | ||
53 | -import br.gov.frameworkdemoiselle.security.SecurityContext; | ||
54 | import br.gov.frameworkdemoiselle.util.Beans; | 51 | import br.gov.frameworkdemoiselle.util.Beans; |
55 | import br.gov.frameworkdemoiselle.util.ResourceBundle; | 52 | import br.gov.frameworkdemoiselle.util.ResourceBundle; |
56 | import br.gov.frameworkdemoiselle.util.Strings; | 53 | import br.gov.frameworkdemoiselle.util.Strings; |
@@ -66,8 +63,6 @@ public class RequiredPermissionInterceptor implements Serializable { | @@ -66,8 +63,6 @@ public class RequiredPermissionInterceptor implements Serializable { | ||
66 | 63 | ||
67 | private static final long serialVersionUID = 1L; | 64 | private static final long serialVersionUID = 1L; |
68 | 65 | ||
69 | - private SecurityContext securityContext; | ||
70 | - | ||
71 | private static ResourceBundle bundle; | 66 | private static ResourceBundle bundle; |
72 | 67 | ||
73 | private static Logger logger; | 68 | private static Logger logger; |
@@ -168,11 +163,7 @@ public class RequiredPermissionInterceptor implements Serializable { | @@ -168,11 +163,7 @@ public class RequiredPermissionInterceptor implements Serializable { | ||
168 | } | 163 | } |
169 | 164 | ||
170 | private SecurityContext getSecurityContext() { | 165 | private SecurityContext getSecurityContext() { |
171 | - if (securityContext == null) { | ||
172 | - securityContext = Beans.getReference(SecurityContext.class); | ||
173 | - } | ||
174 | - | ||
175 | - return securityContext; | 166 | + return Beans.getReference(SecurityContext.class); |
176 | } | 167 | } |
177 | 168 | ||
178 | private static ResourceBundle getBundle() { | 169 | private static ResourceBundle getBundle() { |
impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredRoleInterceptor.java
@@ -63,8 +63,6 @@ public class RequiredRoleInterceptor implements Serializable { | @@ -63,8 +63,6 @@ public class RequiredRoleInterceptor implements Serializable { | ||
63 | 63 | ||
64 | private static final long serialVersionUID = 1L; | 64 | private static final long serialVersionUID = 1L; |
65 | 65 | ||
66 | - private SecurityContext securityContext; | ||
67 | - | ||
68 | private static ResourceBundle bundle; | 66 | private static ResourceBundle bundle; |
69 | 67 | ||
70 | private static Logger logger; | 68 | private static Logger logger; |
@@ -136,11 +134,7 @@ public class RequiredRoleInterceptor implements Serializable { | @@ -136,11 +134,7 @@ public class RequiredRoleInterceptor implements Serializable { | ||
136 | } | 134 | } |
137 | 135 | ||
138 | private SecurityContext getSecurityContext() { | 136 | private SecurityContext getSecurityContext() { |
139 | - if (securityContext == null) { | ||
140 | - securityContext = Beans.getReference(SecurityContext.class); | ||
141 | - } | ||
142 | - | ||
143 | - return securityContext; | 137 | + return Beans.getReference(SecurityContext.class); |
144 | } | 138 | } |
145 | 139 | ||
146 | private static ResourceBundle getBundle() { | 140 | private static ResourceBundle getBundle() { |