"jason.greene(a)jboss.com" wrote : I disagree with the server factory example in
Rule 4. IllegalArgumentException is the appropriate exception to be thrown
|
Of course you're right Jason, the correct code should be:
package org.jboss.bootstrap.api.factory;
|
| public class ServerFactory
| {
| ...
| public static Server<?, ?> createServer(final String implClassName)
| throws IllegalArgumentException, InstantiationException; // this is WRONG, see RULE
4
|
| public static Server<?, ?> createServer(final String implClassName, final
ClassLoader cl)
| throws IllegalArgumentException, InstantiationException // this is WRONG, see RULE
4
| ...
| }
|
| public class ServerFactory
| {
| ...
| public static Server<?, ?> createServer(final String implClassName) // this
is CORRECT
| {
| ...
| catch (InstantiationException ie)
| {
| throws BootstrapException(ie);
| }
| ...
| }
|
| public static Server<?, ?> createServer(final String implClassName, final
ClassLoader cl) // this is CORRECT
| {
| ...
| throw new IllegalArgumentException();
| ...
| }
| ...
| }
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268935#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...