I now have this question because of a code review iteration, in which I created an POJO to be used as a request object, like this one:
class Request {
private List<Item> items;
static class Item{
// ... some other stuff
}
}
and then someone requested to extract the inner class because it was static, meaning that its instances would be treated as if they were automatically static, which would mean that we would only have an instance of type Item while the system was up and stuff, or at least there was that risk though.
I tried to respond by saying that that happens with static values, but this is a static class, which according to what I understand it only affects the way it is instantiated and the access it has to the enclosing classes' fields, but I couldn't find anything in the JLS (or anywhere to be honest) to explicitly support my claim.
Does anyone know whether the guy was right about requesting that change? If not, does anybody know where can I find information to support/prove my argument? Any pointer will do :) Thanks in advance!