Here are the classes involved. Each one has a .html markup file. The actual app is more complicated than this, but I've reduced it to a simple example.
myapp.TemplatePage: Page with standard header that is extended by all other pages. Includes this autolink:
myapp.HomePage: Main page of the application.
myapp.login.LoginPage: Requests a user's login and password.
When I try to access LoginPage, I get a NoClassDefFoundError: IllegalName: myapp/HomePage
I have determined why this is occurring. AutoLinkResolver resolves autolinks to classes first by trying to load a class relative to the page's package, then relative to the parent page's package. However, the first time it calls Packages.absolutePath, it passes the output to Strings.replaceAll to replace forward slashes with periods, while the second time, it doesn't, which leads to the IllegalName error.
The solution is to invoke the class-name-mangling logic from AutoLinkResolver.java lines 396-400 again after the call to Packages.absolutePath on line 428.
Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver. It uses "if" instead of "while." What if the autolink was two levels up in the inheritance hierarchy? I think that it should walk the parent links until it finds a null, not just check the first one.
|Field||Original Value||New Value|
|Assignee||Igor Vaynberg [ ivaynberg ]|
|Fix Version/s||1.4-M4 [ 12313295 ]|
|Resolution||Fixed [ 1 ]|
|Fix Version/s||1.3.5 [ 12313175 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|