diff --git a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java index 87bbfbcf2c808bd25bb443bc12159356372acb8d..e49e9e0234b1d3b0ec921cd8df4d6b51b1bd3029 100644 --- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java +++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java @@ -90,7 +90,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS); protected boolean mmappedIO; - protected boolean ignoreSymbolFile; + protected boolean symbolFileEnabled; protected enum SortFiles implements Comparator { FORWARD { @@ -142,7 +142,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil 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 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil } } + /** + * 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 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil */ 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 --git a/src/share/classes/com/sun/tools/javah/JavahFileManager.java b/src/share/classes/com/sun/tools/javah/JavahFileManager.java index 72160c59992e86948468695559e2bfe9f83929c8..e27eff2fdc9f8618971d7a580117b136ec5f7272 100644 --- a/src/share/classes/com/sun/tools/javah/JavahFileManager.java +++ b/src/share/classes/com/sun/tools/javah/JavahFileManager.java @@ -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 @@ import com.sun.tools.javac.util.Context; class JavahFileManager extends JavacFileManager { private JavahFileManager(Context context, Charset charset) { super(context, true, charset); - setIgnoreSymbolFile(true); + setSymbolFileEnabled(false); } static JavahFileManager create(final DiagnosticListener dl, PrintWriter log) { @@ -56,8 +56,4 @@ class JavahFileManager extends JavacFileManager { return new JavahFileManager(javac_context, null); } - - void setIgnoreSymbolFile(boolean b) { - ignoreSymbolFile = b; - } } diff --git a/src/share/classes/com/sun/tools/javah/JavahTask.java b/src/share/classes/com/sun/tools/javah/JavahTask.java index 16c3be898aa7b7737708e141fee01be858930278..6b8abf9d6d19073d3b83db6cee43ffcdea3e6f56 100644 --- a/src/share/classes/com/sun/tools/javah/JavahTask.java +++ b/src/share/classes/com/sun/tools/javah/JavahTask.java @@ -500,7 +500,7 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { g.setForce(force); if (fileManager instanceof JavahFileManager) - ((JavahFileManager) fileManager).setIgnoreSymbolFile(true); + ((JavahFileManager) fileManager).setSymbolFileEnabled(false); JavaCompiler c = ToolProvider.getSystemJavaCompiler(); List opts = new ArrayList(); diff --git a/src/share/classes/com/sun/tools/javap/JavapFileManager.java b/src/share/classes/com/sun/tools/javap/JavapFileManager.java index 8fa75792dae198f12e54b2461a87e1d3ebe128d0..cf491bf83fa8220ad1e93687536e9df8ca6fa5d0 100644 --- a/src/share/classes/com/sun/tools/javap/JavapFileManager.java +++ b/src/share/classes/com/sun/tools/javap/JavapFileManager.java @@ -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 @@ import com.sun.tools.javac.util.Context; 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 dl, PrintWriter log) { @@ -56,8 +56,4 @@ public class JavapFileManager extends JavacFileManager { return new JavapFileManager(javac_context, null); } - - void setIgnoreSymbolFile(boolean b) { - ignoreSymbolFile = b; - } }