Skip to content
Snippets Groups Projects

Update Development environment

4 files
+ 55
7
Compare changes
  • Side-by-side
  • Inline

Files

@@ -2,6 +2,7 @@ package nl.tudelft.ewi.tam.services;
import nl.tudelft.ewi.tam.annotations.AuthenticatedUser;
import nl.tudelft.ewi.tam.beans.UserPrincipal;
import org.springframework.context.annotation.Profile;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.core.Authentication;
@@ -18,6 +19,7 @@ import java.lang.annotation.Annotation;
* This class resolves the used custom annotations of the platform.
*/
@Service
@Profile("prod")
@SuppressWarnings("PMD.AtLeastOneConstructor")
public class AnnotationResolver implements HandlerMethodArgumentResolver {
@@ -56,7 +58,7 @@ public class AnnotationResolver implements HandlerMethodArgumentResolver {
* @return the annotation or null if not found
*/
@SuppressWarnings("PMD.OnlyOneReturn") // The code becomes more clear when three returns are used.
private <T extends Annotation> T findMethodAnnotation(final Class<T> annotationClass,
protected static <T extends Annotation> T findMethodAnnotation(final Class<T> annotationClass,
final MethodParameter parameter) {
T annotation = parameter.getParameterAnnotation(annotationClass);
Loading