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

Diff of /gjdoc/src/gnu/classpath/tools/gjdoc/Main.java

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

revision 1.67 by julian, Wed May 4 15:41:28 2005 UTC revision 1.68 by julian, Tue May 10 23:22:03 2005 UTC
# Line 484  public final class Main Line 484  public final class Main
484          //--- Create one file object each for a possible package directory          //--- Create one file object each for a possible package directory
485          //         and a possible class file, and find out if they exist.          //         and a possible class file, and find out if they exist.
486    
487          File packageDir = rootDoc.findSourceFile(classOrPackageRelPath);          List packageDirs = rootDoc.findSourceFiles(classOrPackageRelPath);
488          File sourceFile = rootDoc.findSourceFile(classOrPackageRelPath          List sourceFiles = rootDoc.findSourceFiles(classOrPackageRelPath + ".java");
489              + ".java");  
490            boolean packageDirExists = !packageDirs.isEmpty();
491          boolean packageDirExists = packageDir != null          boolean sourceFileExists = !sourceFiles.isEmpty();
             && packageDir.exists()  
             && packageDir.getCanonicalFile().getAbsolutePath().endsWith(  
                 classOrPackageRelPath);  
   
         boolean sourceFileExists = sourceFile != null  
             && sourceFile.exists()  
             && sourceFile.getCanonicalFile().getAbsolutePath().endsWith(  
                 classOrPackageRelPath + ".java");  
492    
493          //--- Complain if neither exists: not found          //--- Complain if neither exists: not found
494    
# Line 520  public final class Main Line 512  public final class Main
512            //--- Otherwise, if the package directory exists, it is a package            //--- Otherwise, if the package directory exists, it is a package
513    
514            else            else
515              if (packageDirExists)              if (packageDirExists) {
516              {                Iterator packageDirIt = packageDirs.iterator();
517                if (!packageDir.isDirectory())                boolean packageDirFound = false;
518                {                while (packageDirIt.hasNext()) {
519                  reporter.printError("File \"" + packageDir                  File packageDir = (File)packageDirIt.next();
520                      + "\" doesn't have .java extension.");                  if (packageDir.isDirectory()) {
521                  shutdown();                    rootDoc.addSpecifiedPackageName(classOrPackage);
522                      packageDirFound = true;
523                      break;
524                    }
525                }                }
526                else                if (!packageDirFound) {
527                {                  reporter.printError("No suitable file or directory found for" + classOrPackage);
528                  rootDoc.addSpecifiedPackageName(classOrPackage);                  shutdown();
529                }                }
530              }              }
531    

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

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