JDK 11 jdk.compiler.jmod - Compiler Tool

JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "javac" command.

JDK 11 Compiler tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.compiler.jmod.

JDK 11 Compiler tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.

JDK 11 Compiler source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.compiler.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

com/sun/tools/javac/processing/ServiceProxy.java

/*
 * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package com.sun.tools.javac.processing;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * Utility class to determine if a service can be found on the
 * path that might be used to create a class loader.
 *
 * <p><b>This is NOT part of any supported API.
 * If you write code that depends on this, you do so at your own risk.
 * This code and its internal interfaces are subject to change or
 * deletion without notice.</b>
 *
 */
// based on sun.misc.Service
class ServiceProxy {
    static class ServiceConfigurationError extends Error {
        static final long serialVersionUID = 7732091036771098303L;

        ServiceConfigurationError(String msg) {
            super(msg);
        }
    }

    private static final String prefix = "META-INF/services/";

    private static void fail(Class<?> service, String msg)
            throws ServiceConfigurationError {
        throw new ServiceConfigurationError(service.getName() + ": " + msg);
    }

    private static void fail(Class<?> service, URL u, int line, String msg)
            throws ServiceConfigurationError {
        fail(service, u + ":" + line + ": " + msg);
    }

    /**
     * Parse the content of the given URL as a provider-configuration file.
     *
     * @param  service
     *         The service class for which providers are being sought;
     *         used to construct error detail strings
     *
     * @param  u
     *         The URL naming the configuration file to be parsed
     *
     * @return true if the name of a service is found
     *
     * @throws ServiceConfigurationError
     *         If an I/O error occurs while reading from the given URL, or
     *         if a configuration-file format error is detected
     */
    private static boolean parse(Class<?> service, URL u) throws ServiceConfigurationError {
        InputStream in = null;
        BufferedReader r = null;
        try {
            in = u.openStream();
            r = new BufferedReader(new InputStreamReader(in, "utf-8"));
            int lc = 1;
            String ln;
            while ((ln = r.readLine()) != null) {
                int ci = ln.indexOf('#');
                if (ci >= 0) ln = ln.substring(0, ci);
                ln = ln.trim();
                int n = ln.length();
                if (n != 0) {
                    if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0))
                        fail(service, u, lc, "Illegal configuration-file syntax");
                    int cp = ln.codePointAt(0);
                    if (!Character.isJavaIdentifierStart(cp))
                        fail(service, u, lc, "Illegal provider-class name: " + ln);
                    for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
                        cp = ln.codePointAt(i);
                        if (!Character.isJavaIdentifierPart(cp) && (cp != '.'))
                            fail(service, u, lc, "Illegal provider-class name: " + ln);
                    }
                    return true;
                }
            }
        } catch (FileNotFoundException x) {
            return false;
        } catch (IOException x) {
            fail(service, ": " + x);
        } finally {
            try {
                if (r != null) r.close();
            } catch (IOException y) {
                fail(service, ": " + y);
            }
            try {
                if (in != null) in.close();
            } catch (IOException y) {
                fail(service, ": " + y);
            }
        }
        return false;
    }

    /**
     * Return true if a description for at least one service is found in the
     * service configuration files in the given URLs.
     */
    public static boolean hasService(Class<?> service, URL[] urls)
            throws ServiceConfigurationError {
        for (URL url: urls) {
            try {
                String fullName = prefix + service.getName();
                URL u = new URL(url, fullName);
                boolean found = parse(service, u);
                if (found)
                    return true;
            } catch (MalformedURLException e) {
                // should not happen; ignore it if it does
            }
        }
        return false;
    }
}

com/sun/tools/javac/processing/ServiceProxy.java

 

JDK 11 jdk.crypto.cryptoki.jmod - Crypto KI Module

JDK 11 jdk.charsets.jmod - Charsets Module

Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-08-13, 20619👍, 0💬