/[classpath]/gjdoc/src/gnu/classpath/tools/doclets/AbstractDoclet.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/doclets/AbstractDoclet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by julian, Wed Dec 8 19:50:00 2004 UTC revision 1.5 by julian, Fri Dec 10 18:20:52 2004 UTC
# Line 904  public abstract class AbstractDoclet Line 904  public abstract class AbstractDoclet
904      *      *
905      *  @throws IOException if the source directory couldn't be      *  @throws IOException if the source directory couldn't be
906      *  located.      *  located.
907        *
908        *  @return List of File
909      */      */
910     protected File getPackageSourceDir(PackageDoc packageDoc)     protected List getPackageSourceDirs(PackageDoc packageDoc)
911        throws IOException        throws IOException
912     {     {
913        if (null == sourcePaths) {        if (null == sourcePaths) {
# Line 927  public abstract class AbstractDoclet Line 929  public abstract class AbstractDoclet
929    
930        String packageSubDir = packageDoc.name().replace('.', File.separatorChar);        String packageSubDir = packageDoc.name().replace('.', File.separatorChar);
931        Iterator it = sourcePaths.iterator();        Iterator it = sourcePaths.iterator();
932          List result = new LinkedList();
933        while (it.hasNext()) {        while (it.hasNext()) {
934           File pathComponent = (File)it.next();           File pathComponent = (File)it.next();
935           File packageDir = new File(pathComponent, packageSubDir);           File packageDir = new File(pathComponent, packageSubDir);
936           if (packageDir.exists()) {           if (packageDir.exists()) {
937              return packageDir;              result.add(packageDir);
938           }           }
939        }        }
940        throw new IOException("Couldn't locate source directory for package " + packageDoc.name());        if (result.isEmpty()) {
941             throw new IOException("Couldn't locate source directory for package " + packageDoc.name());
942          }
943          else {
944             return result;
945          }
946       }
947    
948       protected File getSourceFile(ClassDoc classDoc)
949          throws IOException
950       {
951          List packageDirs = getPackageSourceDirs(classDoc.containingPackage());
952          Iterator it = packageDirs.iterator();
953          while (it.hasNext()) {
954             File packageDir = (File)it.next();
955             File sourceFile = new File(packageDir, getOuterClassDoc(classDoc).name() + ".java");
956             if (sourceFile.exists()) {
957                return sourceFile;
958             }
959          }
960    
961          throw new IOException("Couldn't locate source file for class " + classDoc.qualifiedTypeName());
962     }     }
963    
964     protected void printError(String error)     protected void printError(String error)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26