# HG changeset patch # User jjg # Date 1351294857 25200 # Node ID 598fd301e4de91be0c79524cc797e9cb900a1661 # Parent 2814fa6977ac5388cefef07a85e27b397e92727c 8001229: refactor javac so that ct.sym is just used for javac, not all clients of JavacFileManager Reviewed-by: mcimadamore diff -r 2814fa6977ac -r 598fd301e4de langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java --- a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java Fri Oct 26 13:10:56 2012 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java Fri Oct 26 16:40:57 2012 -0700 @@ -90,7 +90,7 @@ EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS); protected boolean mmappedIO; - protected boolean ignoreSymbolFile; + protected boolean symbolFileEnabled; protected enum SortFiles implements Comparator<File> { FORWARD { @@ -142,7 +142,7 @@ zipFileIndexCache = ZipFileIndexCache.getSharedInstance(); mmappedIO = options.isSet("mmappedIO"); - ignoreSymbolFile = options.isSet("ignore.symbol.file"); + symbolFileEnabled = !options.isSet("ignore.symbol.file"); String sf = options.get("sortFiles"); if (sf != null) { @@ -150,6 +150,13 @@ } } + /** + * Set whether or not to use ct.sym as an alternate to rt.jar. + */ + public void setSymbolFileEnabled(boolean b) { + symbolFileEnabled = b; + } + @Override public boolean isDefaultBootClassPath() { return locations.isDefaultBootClassPath(); @@ -466,7 +473,7 @@ */ private Archive openArchive(File zipFileName, boolean useOptimizedZip) throws IOException { File origZipFileName = zipFileName; - if (!ignoreSymbolFile && locations.isDefaultBootClassPathRtJar(zipFileName)) { + if (symbolFileEnabled && locations.isDefaultBootClassPathRtJar(zipFileName)) { File file = zipFileName.getParentFile().getParentFile(); // ${java.home} if (new File(file.getName()).equals(new File("jre"))) file = file.getParentFile(); diff -r 2814fa6977ac -r 598fd301e4de langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java --- a/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java Fri Oct 26 13:10:56 2012 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java Fri Oct 26 16:40:57 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2012, 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 @@ -44,7 +44,7 @@ class JavahFileManager extends JavacFileManager { private JavahFileManager(Context context, Charset charset) { super(context, true, charset); - setIgnoreSymbolFile(true); + setSymbolFileEnabled(false); } static JavahFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { @@ -56,8 +56,4 @@ return new JavahFileManager(javac_context, null); } - - void setIgnoreSymbolFile(boolean b) { - ignoreSymbolFile = b; - } } diff -r 2814fa6977ac -r 598fd301e4de langtools/src/share/classes/com/sun/tools/javah/JavahTask.java --- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Fri Oct 26 13:10:56 2012 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Fri Oct 26 16:40:57 2012 -0700 @@ -500,7 +500,7 @@ g.setForce(force); if (fileManager instanceof JavahFileManager) - ((JavahFileManager) fileManager).setIgnoreSymbolFile(true); + ((JavahFileManager) fileManager).setSymbolFileEnabled(false); JavaCompiler c = ToolProvider.getSystemJavaCompiler(); List<String> opts = new ArrayList<String>(); diff -r 2814fa6977ac -r 598fd301e4de langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java --- a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java Fri Oct 26 13:10:56 2012 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java Fri Oct 26 16:40:57 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2012, 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 @@ -44,7 +44,7 @@ public class JavapFileManager extends JavacFileManager { private JavapFileManager(Context context, Charset charset) { super(context, true, charset); - setIgnoreSymbolFile(true); + setSymbolFileEnabled(false); } public static JavapFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { @@ -56,8 +56,4 @@ return new JavapFileManager(javac_context, null); } - - void setIgnoreSymbolFile(boolean b) { - ignoreSymbolFile = b; - } }