src/share/classes/com/sun/tools/sjavac/comp/JavaCompilerWithDeps.java

Print this page




  85                 pathb.append("/");
  86                 pathb.append(o);
  87                 first = false;
  88             }
  89             pathb.append("/");
  90             String path = pathb.toString();
  91 
  92             // Now cut the uri to be: file:///mybuild/jdk/gensrc/javax/swing/beaninfo/
  93             String p = sym.sourcefile.toUri().getPath();
  94             // Do not use File.separatorChar here, a URI always uses slashes /.
  95             int i = p.lastIndexOf("/");
  96             String pp = p.substring(0,i+1);
  97 
  98             // Now check if the truncated uri ends with the path. (It does not == failure!)
  99             if (path.length() > 0 && !path.equals("/unnamed package/") && !pp.endsWith(path)) {
 100                 javacService.logError("Error: The source file "+sym.sourcefile.getName()+
 101                                         " is located in the wrong package directory, because it contains the class "+
 102                                         sym.getQualifiedName());
 103             }
 104         }
 105         deps.visitPubapi(sym);
 106     }
 107 }


  85                 pathb.append("/");
  86                 pathb.append(o);
  87                 first = false;
  88             }
  89             pathb.append("/");
  90             String path = pathb.toString();
  91 
  92             // Now cut the uri to be: file:///mybuild/jdk/gensrc/javax/swing/beaninfo/
  93             String p = sym.sourcefile.toUri().getPath();
  94             // Do not use File.separatorChar here, a URI always uses slashes /.
  95             int i = p.lastIndexOf("/");
  96             String pp = p.substring(0,i+1);
  97 
  98             // Now check if the truncated uri ends with the path. (It does not == failure!)
  99             if (path.length() > 0 && !path.equals("/unnamed package/") && !pp.endsWith(path)) {
 100                 javacService.logError("Error: The source file "+sym.sourcefile.getName()+
 101                                         " is located in the wrong package directory, because it contains the class "+
 102                                         sym.getQualifiedName());
 103             }
 104         }
 105         deps.visitPubapiOfSource(sym);
 106     }
 107 }