/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Utility methods for building a filemanager.
* There are no references here to file-system specific objects such as
* java.io.File or java.nio.file.Path.
*/
public abstract class BaseFileManager {
byteBufferCache = new ByteBufferCache();
}
/**
* Set the context for JavacPathFileManager.
*/
}
/**
* The log to be used for error reporting.
*/
/**
* User provided charset (through javax.tools).
*/
if (sourceName != null)
}
// Bug: 6558476
// Ideally, ClassLoader should be Closeable, but before JDK7 it is not.
// On older versions, try the following, to get a closeable classloader.
// 1: Allow client to specify the class to use via hidden option
if (classLoaderClass != null) {
try {
} catch (Throwable t) {
// ignore errors loading user-provided class loader, fall through
}
}
// 2: If URLClassLoader implements Closeable, use that.
// 3: Try using private reflection-based CloseableURLClassLoader
try {
} catch (Throwable t) {
// ignore errors loading workaround class loader, fall through
}
// 4: If all else fails, use plain old standard URLClassLoader
}
// <editor-fold defaultstate="collapsed" desc="Option handling">
for (JavacOption o: javacFileManagerOptions) {
if (o.hasArg()) {
return true;
}
} else {
return true;
}
// operand missing, or process returned false
throw new IllegalArgumentException(current);
}
}
return false;
}
// where
new RecognizedOptions.GrumpyHelper());
for (JavacOption o : javacFileManagerOptions) {
}
return -1;
}
public abstract boolean isDefaultBootClassPath();
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Encoding">
if (defaultEncodingName == null) {
}
return defaultEncodingName;
}
return getDefaultEncodingName();
else
return encName;
}
try {
} catch (IllegalCharsetNameException e) {
} catch (UnsupportedCharsetException e) {
}
// slightly overestimate the buffer size to avoid reallocation.
float factor =
while (true) {
// make sure there is at least one extra character
}
return dest;
int newCapacity =
// bad character in input
// report coding error (warn only pre 1.5)
if (!getSource().allowEncodingErrors()) {
"illegal.char.for.encoding",
} else {
"illegal.char.for.encoding",
}
// skip past the coding error
// undo the flip() to prepare the output buffer
// for more translation
} else {
throw new AssertionError(result);
}
}
// unreached
}
: this.charset;
if (ignoreEncodingErrors)
else
return decoder
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="ByteBuffers">
/**
* Make a byte buffer from an input stream.
*/
throws IOException {
int position = 0;
// expand buffer
result = ByteBuffer.
if (count < 0) break;
}
}
}
/**
* A single-element cache of direct byte buffers.
*/
private static class ByteBufferCache {
return result;
}
cached = x;
}
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Content cache">
if (e == null)
return null;
return null;
}
return e.getValue();
}
}
}
protected static class ContentCacheEntry {
final long timestamp;
}
}
}
}
// </editor-fold>
else
}
protected static <T> T nullCheck(T o) {
o.getClass(); // null check
return o;
}
for (T t : it)
t.getClass(); // null check
return it;
}
}