Vadim Gritsenko dijo: > Carsten Ziegeler wrote: > >>Antonio Gallardo wrote: >> >> >>>Antonio Gallardo dijo: >>> >>> >>>>Hi: >>>> >>>>I also have another question. We have some exceptions that are not >>>>being throw at all, but the method declare it. Sample at line 76: >>>> >>>> >>>Filling the missing link :( >>> >>>http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/xsp/ja >>>va/org/apache/cocoon/components/language/markup/Logicsheet.jav >>>a?annotate=1.3 >>> >>> >>>>The constructor does not throw any of the declared Exceptions. >>>> >>>>Can we clean up this code? There are cca 150 similar places >>>> >>>> >>>over the code. >>> >>> >>In general I'm +1 for such changes, but unfortunately these are >> incompatible >>changes! For example, if a client has a try/catch clause for such >>an exception and you remove it from the list, then the client code >>is not compilable anymore as the exception is not thrown inside >>the block anymore. >>So, I would say, let's leave them there (but I'm not opposed to remove >> them >>:) ). >> >> > > "Throws" declarations can be safely removed in the situation when method > implements an interface. Interface will have exception declarations, and > interface implementation might not have them if it does not need them. > > In all other situations, Carsten is right - this might cause backward > incompatibility. This is important for user-facing classes. Should we > start marking classes as internal, like "<b>INTERNAL!!!</b>" in javadoc > or some such?
You got on the right thing! For a cleaner code, I believe we need to define what is supposed to be internal API and what not. Sharing a lot of code also just because it has a "public" tag does not mean want users use it. Best Regards, Antonio Gallardo
