JDK 11 jdk.jshell.jmod - JShell Tool

JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell" command.

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

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

JDK 11 JShell tool source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.jshell.

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

✍: FYIcenter

jdk/jshell/Diag.java

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

package jdk.jshell;

import java.util.Locale;
import javax.tools.Diagnostic;

/**
 * Diagnostic information for a Snippet.
 *
 * @since 9
 * @see jdk.jshell.JShell#diagnostics(jdk.jshell.Snippet)
 */
public abstract class Diag {
    // Simplified view on compiler Diagnostic.

    /**
     * In-package creation only.
     */
    Diag() {
    }

    /**
     * Used to signal that no position is available.
     */
    public final static long NOPOS = Diagnostic.NOPOS;

    /**
     * Indicates whether this diagnostic is an error (as opposed to a warning or
     * note).
     *
     * @return {@code true} if this diagnostic is an error; otherwise {@code false}
     */
    public abstract boolean isError();

    /**
     * Returns a character offset from the beginning of the source object
     * associated with this diagnostic that indicates the location of
     * the problem.  In addition, the following must be true:
     *
     * <p>{@code getStartPostion() <= getPosition()}
     * <p>{@code getPosition() <= getEndPosition()}
     *
     * @return character offset from beginning of source; {@link
     * #NOPOS} if the position is not available.
     */
    public abstract long getPosition();

    /**
     * Returns the character offset from the beginning of the file
     * associated with this diagnostic that indicates the start of the
     * problem.
     *
     * @return offset from beginning of file; {@link #NOPOS} if and
     * only if {@link #getPosition()} returns {@link #NOPOS}
     */
    public abstract long getStartPosition();

    /**
     * Returns the character offset from the beginning of the file
     * associated with this diagnostic that indicates the end of the
     * problem.
     *
     * @return offset from beginning of file; {@link #NOPOS} if and
     * only if {@link #getPosition()} returns {@link #NOPOS}
     */
    public abstract long getEndPosition();

    /**
     * Returns a diagnostic code indicating the type of diagnostic.  The
     * code is implementation-dependent and might be {@code null}.
     *
     * @return a diagnostic code
     */
    public abstract String getCode();

    /**
     * Returns a localized message for the given locale.  The actual
     * message is implementation-dependent.  If the locale is {@code
     * null} use the default locale.
     *
     * @param locale a locale; might be {@code null}
     * @return a localized message
     */
    public abstract String getMessage(Locale locale);

    // *** Internal support ***

    /**
     * Internal: If this is from a compile/analyze wrapped in an outer class, extract the snippet.
     * Otherwise null.
     */
    Snippet snippetOrNull() {
        return null;
    }

    /**
     * This is an unreachable-statement error
     */
    boolean isUnreachableError() {
        return getCode().equals("compiler.err.unreachable.stmt");
    }

    /**
     * This is a not-a-statement error
     */
    boolean isNotAStatementError() {
        return getCode().equals("compiler.err.not.stmt");
    }

    /**
     * This is a resolution error.
     */
    boolean isResolutionError() {
        //TODO: try javac RESOLVE_ERROR flag
        return getCode().startsWith("compiler.err.cant.resolve")
                || getCode().equals("compiler.err.cant.apply.symbol");
    }
}

jdk/jshell/Diag.java

 

Or download all of them as a single archive file:

File name: jdk.jshell-11.0.1-src.zip
File size: 283093 bytes
Release date: 2018-11-04
Download 

 

JDK 11 jdk.jsobject.jmod - JS Object Module

JDK 11 jdk.jlink.jmod - JLink Tool

Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-06-30, 29377👍, 0💬