Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6415780

JSR 199: javax.tools.JavaFileManager.getClassLoader always fails

    Details

    • Subcomponent:
    • Resolved In Build:
      b85
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      javax.tools.JavaFileManager.getClassLoader always fails

      test:
      ------------------------------
      import javax.tools.*;
      import java.io.File;
      import java.util.Collections;

      public class test3 {

          static public void main(String[] args){
              File dir = new File( new File(".").toURI() );

              StandardJavaFileManager sfm =
                  ToolProvider.getSystemJavaCompilerTool().
                      getStandardFileManager( new DiagnosticCollector<JavaFileObject>() );

              JavaFileManager.Location location = StandardJavaFileManager.StandardLocation.SOURCE_PATH;
              sfm.setLocation( location, Collections.singleton(dir) );

              try {
                  sfm.getClassLoader(location);
                  System.out.println("OK");
              } catch( Exception x ){
                  x.printStackTrace( System.out );
              }
          }
      }
      ------------------------------
      result:
      ------------------------------
      java.lang.UnsupportedOperationException
          at com.sun.tools.javac.util.ListBuffer.add(ListBuffer.java:205)
          at com.sun.tools.javac.util.DefaultFileManager.getClassLoader(DefaultFileManager.java:664)
          at test3.main(test3.java:18)
      tests failed
      > api/javax_tools/FileManager/index.html#All[getClassLoader0001]
      > api/javax_tools/FileManager/index.html#All[getClassLoader0002]
      > api/javax_tools/FileManager/index.html#All[getClassLoader0003]
      > api/javax_tools/FileManager/index.html#All[getClassLoader0004]
      > api/javax_tools/FileManager/index.html#All[getClassLoader0005]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ahe Peter Ahe
                Reporter:
                itseytin Igor Tseytin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: