You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Berin Loritsch <bl...@apache.org> on 2003/05/30 17:34:52 UTC
Incompatible change with Exception
The new throws exception on the getInterfaces() method is not
backwards compatible. I will add something to catch exceptions
in my own code for future proofing, but you can't add new
exceptions to a method and have it work with existing code.
My project fails GUMP due to this change:
@@ -766,17 +838,12 @@
/**
* Get interfaces directly implemented by this JavaClass.
*/
- public JavaClass[] getInterfaces() {
- String[] interfaces = getInterfaceNames();
- JavaClass[] classes = new JavaClass[interfaces.length];
+ public JavaClass[] getInterfaces() throws ClassNotFoundException {
+ String[] interfaces = getInterfaceNames();
+ JavaClass[] classes = new JavaClass[interfaces.length];
- try {
- for(int i = 0; i < interfaces.length; i++) {
- classes[i] = repository.loadClass(interfaces[i]);
- }
- } catch(ClassNotFoundException e) {
- System.err.println(e);
- return null;
+ for (int i = 0; i < interfaces.length; i++) {
+ classes[i] = repository.loadClass(interfaces[i]);
}
return classes;
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org