[ http://jira.codehaus.org/browse/QDOX-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Scholte resolved QDOX-81. -------------------------------- Resolution: Cannot Reproduce Assignee: Robert Scholte Let's close it as {{cannot reproduce}}. Main reason is that I've refactored the classlibrary/parser architecture, so it's pretty unlikely that this is still a problem. > JavaSource.getURL should be available at parse-time. > ---------------------------------------------------- > > Key: QDOX-81 > URL: http://jira.codehaus.org/browse/QDOX-81 > Project: QDox > Issue Type: Improvement > Components: Java API > Affects Versions: 1.5, 1.6, 1.7 > Environment: Windows 2000, jdk 1.4.2, ANT 1.5.4, Eclipse 3.0 / 3.1M4, > QDOX: 1.5 as well as cvs-checkout. > Reporter: Achim Westermann > Assignee: Robert Scholte > Original Estimate: 1 hour > Remaining Estimate: 1 hour > > Description: > At parse-time, when the JavaSource Object is created by the JavadocBuilder -> > (ModelBuilder <-> parser), the URL member of the JavaSource (source) is not > set. This is due to the chaining: > addSource(File file){ > -> addSource(URL url){ > -> addSource(Reader reader, String sourceInfo){ > } > <aJavaSource>.setURL(url); > } > } > Problem: > A custom DocletTagFactory (constructor) may be used to parse for Annotations. > It might be very useful to report syntax-errors from this custom parser. But > these reporting is useless, when no information about the current url being > processed is at hand. The DocletTagFactory or the triggered custom parser > cannot access that information. The sourceInfo String is provided for the > qdox parser's exception reporting, but that information is not available for > the DocletTagFactory as well. Throwing an Exception would be a way of > bringing the file name to the console, but warnings or debugging should not > terminate the application. > Suggestion: > Medium change of the API: > Strip the creation of the JavaSource Object out of the ModelBuilder. Feed the > ModelBuilder with a JavaSource instance (replace no-arg Constructor and > extend the 2nd) that is already initialized with the URL. > Within JavadocBuilder: > change > addSource(Reader reader, String sourceInfo) > to > addSource(Reader reader, JavaSource source) > and declare it private (delegation only). > The code will then look like: > ModelBuilder builder = new ModelBuilder( > classLibrary, > docletTagFactory, > source > ); > ... > remove > addSource(Reader reader) > change code of method: > addSource(URL url){ > JavaSource source = new JavaSource(); > source.setURL(url); > addSource(new InputStreamReader(url.openStream(),encoding),source); > return source; > } > Ok, ok, I completely have no clue about the side effects of this suggested > refactoring. But would be pleased, if you do. > BTW: Great work, really. I used xjavadoc and switched to QDox. Similar API, > same author, improved from scratch. > Achim -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email