If I have class like this, which is essentially just a package object, is it breaking standards to have it follow the package naming conventions? I thought I remembered reading this in the OCJP study guides. Seems logical but my co-worker called this out and I'm not sure if there is any official stance from oracle on this.
public class exceptions {
public static class TemplateRenderException extends Exception {
public TemplateRenderException(String message, Throwable e) {
super(message, e);
}
}
public static class UnmarshallingException extends Exception {
public UnmarshallingException(String message, Throwable e) {
super(message, e);
}
}
}
If I have class like this, which is essentially just a package object, is it breaking standards to have it follow the package naming conventions?
Yes. It's not a package, it's a class, so it should follow class naming conventions... or better yet, just make it a package instead, given that it sounds like you want it to act like a package. That's if you really and truly think it's a good idea to have a clustering like this for exceptions, rather than putting them in the package where they're most relevant - the latter is what I'd do, personally.
See more on this question at Stackoverflow