Answer the question
In order to leave comments, you need to log in
MvcWebApplicationInitializer, what is the build warning about?
The class itself:
public class MvcWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] {AppConfig.class, WebSecurityConfig.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] {WebConfig.class};
}
@Override
protected String[] getServletMappings() {
return new String[] {"/"};
}
}
[WARNING] путь\config\MvcWebApplicationInitializer.java:[9,13] [rawtypes] found raw type: Class
missing type arguments for generic class Class<T>
where T is a type-variable: T extends Object declared in class Class
[WARNING] путь\config\MvcWebApplicationInitializer.java:[14,13] [rawtypes] found raw type: Class
Answer the question
In order to leave comments, you need to log in
In the first two methods, you describe the return value as a Class<?>{}. This can be interpreted as "an array of classes typed with an unknown type". In doing so, you return a Class[] (without the <?>), which is interpreted as "an array of classes not typed by any type". For the compiler, in principle, there is not much difference between these entries, so it only issues a warning that an array of typed Class was expected to be returned, but an array of untyped ones is returned.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question