Bug 70008 - problem with ajdoc -public
Summary: problem with ajdoc -public
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: AJDoc (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-14 07:16 EDT by Matt Chapman CLA
Modified: 2004-10-21 04:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Chapman CLA 2004-07-14 07:16:55 EDT
Using the spacewar example, the following works fine:
    ajdoc -private -d doc spacewar coordination
but the following breaks:
    ajdoc -public -d doc spacewar coordination

The end of the failing output is below. Display.html and
Display.DisplayAspect.html were not generated as the types are not public, so
presumably the decorator shouldn't be looking for them in this case.

> Decorating html files...
> Decorating C:\aspectj1.2\doc\examples\doc\spacewar\Debug.html...
> Decorating C:\aspectj1.2\doc\examples\doc\spacewar\Display.DisplayAspect.html.
..
An internal error occured in ajdoc
Please copy the following text into an email message and send it,
along with any additional information you can add to:

       aspectj-dev@eclipse.org


java.io.FileNotFoundException: C:\aspectj1.2\doc\examples\doc\spacewar\Display.D
isplayAspect.html (The system cannot find the file specified)
java.io.FileNotFoundException: C:\aspectj1.2\doc\examples\doc\spacewar\Display.D
isplayAspect.html (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileReader.<init>(FileReader.java:55)
        at org.aspectj.tools.ajdoc.HtmlDecorator.decorateHTMLFile(HtmlDecorator.
java:142)
        at org.aspectj.tools.ajdoc.HtmlDecorator.decorateHTMLFromDecl(HtmlDecora
tor.java:115)
        at org.aspectj.tools.ajdoc.HtmlDecorator.decorateHTMLFromDecls(HtmlDecor
ator.java:54)
        at org.aspectj.tools.ajdoc.HtmlDecorator.decorateHTMLFromInputFiles(Html
Decorator.java:43)
        at org.aspectj.tools.ajdoc.Main.main(Main.java:210)
Comment 1 Mik Kersten CLA 2004-07-14 16:14:32 EDT
Fixed.

This turned out to be a trickier problem, and I expanded the CoverageTestCase 
and SpacewarTestCase tests to cover it more thoroughly.  In a nutshell, the 
compiler's AST makes any nested aspect "public" accessiblity, whether it is 
declared "package" or "private" visibility.  This results in a mismmatch 
between the structure model and the source code.

I was tempted to fix this by making the structure model treat those aspects as 
private.  However, this would be a somewhat time consuming operation since it 
would need to parse the original source code rather than relying on the AST.  
So instead I made ajdoc treat this case correctly.

PLEASE NOTE THE SIDE-EFFECT of keeping this behavior: the outline view will 
continue to show private/package nested aspects as public, sine that's what's 
in the bytecode.
Comment 2 Andrew Clement CLA 2004-07-15 04:38:49 EDT
Matt - I've just checked in a new org.aspectj.ajde with Miks fix in it - can you
test it?
Comment 3 Matt Chapman CLA 2004-07-15 04:58:59 EDT
I've verified the fix from AJDT. Thanks guys.
Comment 4 Adrian Colyer CLA 2004-10-21 04:30:48 EDT
Fix released as part of AspectJ 1.2.1