roycezhc / doclava

Automatically exported from code.google.com/p/doclava
Apache License 2.0
0 stars 0 forks source link

ClearPage slash error(soft error) #53

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Android AOSP SDK builds use doclava 1.0.3 source in doclava-1.0.5 in the 
getPathToRoot method in ClearPage.java class an extra slash or pos is added 
that should not be there:

public static String getPathToRoot(String path) {
    String toroot;
    if (ClearPage.toroot != null) {
      toroot = ClearPage.toroot;
    } else {
      int slashcount = countSlashes(path) - 1;
      if (slashcount > 0) {
        toroot = "";
        for (int i = 0; i < slashcount; i++) {
          toroot += "../";
        }
      } else {
        toroot = "./";
      }
    }
    return toroot;
  }

It should be, I think:

public static String getPathToRoot(String path) {
    String toroot;
    if (ClearPage.toroot != null) {
      toroot = ClearPage.toroot;
    } else {
      int slashcount = countSlashes(path);
      if (slashcount > 0) {
        toroot = "";
        for (int i = 0; i < slashcount; i++) {
          toroot += "../";
        }
      } else {
        toroot = "./";
      }
    }
    return toroot;
  }

I am going to fork my own copy of doclava and make the change and test..very 
sure my suggested correction fixes it.

Original issue reported on code.google.com by fred.gr...@gmail.com on 10 Jun 2012 at 12:16

GoogleCodeExporter commented 9 years ago
Here is the hack I came up with..asking for input as you still have to make 
changes in 6 places to put reference/

But it does fix the problem with doing embedded docs..I was able to have other 
files in the /javadocs folder and a linkbar linking to them throughout the 
javadocs and it comes up right/valid links..

But right now its alpha tested..I still need to test the use case where you 
have subfolders of nonjavadoc content..

So once asking for input is this the way to go or do you have suggestions of a 
better solution?

Original comment by fred.gr...@gmail.com on 10 Jun 2012 at 10:35

Attachments:

GoogleCodeExporter commented 9 years ago
ah folks the error still exist for 1.0.6 as well. as no diff form 1.0.5 
Clearpage.java to 1.0.6..

Now I talk the Google recruiters that I will not talk to them about android 
opportunities until someone looks at this..

Come on folks other people use this beside the Android Sdk engineers..

Original comment by fred.gr...@gmail.com on 6 Sep 2012 at 3:34