< prev index next >

test/tools/javac/api/T6358786.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 47,57 **** JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); try (StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null)) { String srcdir = System.getProperty("test.src"); File file = new File(srcdir, args[0]); List<String> options = Arrays.asList( ! "-XaddExports:jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" ); JavacTaskImpl task = (JavacTaskImpl)tool.getTask(null, fm, null, options, null, fm.getJavaFileObjectsFromFiles(Arrays.asList(file))); Elements elements = task.getElements(); for (Element clazz : task.enter(task.parse())) { String doc = elements.getDocComment(clazz); --- 47,57 ---- JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); try (StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null)) { String srcdir = System.getProperty("test.src"); File file = new File(srcdir, args[0]); List<String> options = Arrays.asList( ! "--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" ); JavacTaskImpl task = (JavacTaskImpl)tool.getTask(null, fm, null, options, null, fm.getJavaFileObjectsFromFiles(Arrays.asList(file))); Elements elements = task.getElements(); for (Element clazz : task.enter(task.parse())) { String doc = elements.getDocComment(clazz);
< prev index next >