src/share/classes/com/sun/tools/javac/api/JavacTool.java

changeset 2075
82044fe8c7f7
parent 1460
92fcf299cd09
child 2525
2eb010b6cb22
     1.1 --- a/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Fri Sep 27 13:06:38 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Fri Sep 27 16:05:56 2013 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2005, 2013, 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 @@ -120,7 +120,6 @@
    1.11          try {
    1.12              ClientCodeWrapper ccw = ClientCodeWrapper.instance(context);
    1.13  
    1.14 -            final String kindMsg = "All compilation units must be of SOURCE kind";
    1.15              if (options != null)
    1.16                  for (String option : options)
    1.17                      option.getClass(); // null check
    1.18 @@ -132,8 +131,11 @@
    1.19              if (compilationUnits != null) {
    1.20                  compilationUnits = ccw.wrapJavaFileObjects(compilationUnits); // implicit null check
    1.21                  for (JavaFileObject cu : compilationUnits) {
    1.22 -                    if (cu.getKind() != JavaFileObject.Kind.SOURCE)
    1.23 +                    if (cu.getKind() != JavaFileObject.Kind.SOURCE) {
    1.24 +                        String kindMsg = "Compilation unit is not of SOURCE kind: "
    1.25 +                                + "\"" + cu.getName() + "\"";
    1.26                          throw new IllegalArgumentException(kindMsg);
    1.27 +                    }
    1.28                  }
    1.29              }
    1.30  

mercurial