src/share/classes/com/sun/tools/javac/file/JavacFileManager.java

changeset 698
f94af0667151
parent 581
f2fdd52e4e87
child 700
7b413ac1a720
     1.1 --- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Tue Sep 28 22:46:36 2010 +0530
     1.2 +++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Sep 29 14:01:37 2010 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -605,7 +605,7 @@
    1.11          nullCheck(className);
    1.12          nullCheck(kind);
    1.13          if (!sourceOrClass.contains(kind))
    1.14 -            throw new IllegalArgumentException("Invalid kind " + kind);
    1.15 +            throw new IllegalArgumentException("Invalid kind: " + kind);
    1.16          return getFileForInput(location, RelativeFile.forClass(className, kind));
    1.17      }
    1.18  
    1.19 @@ -658,7 +658,7 @@
    1.20          nullCheck(className);
    1.21          nullCheck(kind);
    1.22          if (!sourceOrClass.contains(kind))
    1.23 -            throw new IllegalArgumentException("Invalid kind " + kind);
    1.24 +            throw new IllegalArgumentException("Invalid kind: " + kind);
    1.25          return getFileForOutput(location, RelativeFile.forClass(className, kind), sibling);
    1.26      }
    1.27  
    1.28 @@ -672,7 +672,7 @@
    1.29          // validatePackageName(packageName);
    1.30          nullCheck(packageName);
    1.31          if (!isRelativeUri(relativeName))
    1.32 -            throw new IllegalArgumentException("relativeName is invalid");
    1.33 +            throw new IllegalArgumentException("Invalid relative name: " + relativeName);
    1.34          RelativeFile name = packageName.length() == 0
    1.35              ? new RelativeFile(relativeName)
    1.36              : new RelativeFile(RelativeDirectory.forPackage(packageName), relativeName);
    1.37 @@ -806,6 +806,8 @@
    1.38          String path = uri.normalize().getPath();
    1.39          if (path.length() == 0 /* isEmpty() is mustang API */)
    1.40              return false;
    1.41 +        if (!path.equals(uri.getPath())) // implicitly checks for embedded . and ..
    1.42 +            return false;
    1.43          char first = path.charAt(0);
    1.44          return first != '.' && first != '/';
    1.45      }

mercurial