com.sun.tools.javac.api.DiagnosticFormatter.Configuration.DiagnosticPart Java Examples

The following examples show how to use com.sun.tools.javac.api.DiagnosticFormatter.Configuration.DiagnosticPart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractDiagnosticFormatter.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #2
Source File: AbstractDiagnosticFormatter.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #3
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #4
Source File: AbstractDiagnosticFormatter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #5
Source File: AbstractDiagnosticFormatter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #6
Source File: AbstractDiagnosticFormatter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #7
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #8
Source File: AbstractDiagnosticFormatter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #9
Source File: AbstractDiagnosticFormatter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #10
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public SimpleConfiguration(Set<DiagnosticPart> parts) {
    multilineLimits = new HashMap<MultilineLimit, Integer>();
    setVisible(parts);
    setMultilineLimit(MultilineLimit.DEPTH, -1);
    setMultilineLimit(MultilineLimit.LENGTH, -1);
    setCaretEnabled(true);
}
 
Example #11
Source File: ForwardingDiagnosticFormatter.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Set<DiagnosticPart> getVisible() {
    return configuration.getVisible();
}
 
Example #12
Source File: AbstractDiagnosticFormatter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void setVisiblePart(DiagnosticPart diagParts, boolean enabled) {
    if (enabled)
        visibleParts.add(diagParts);
    else
        visibleParts.remove(diagParts);
}
 
Example #13
Source File: AbstractDiagnosticFormatter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void setVisible(Set<DiagnosticPart> diagParts) {
    visibleParts = EnumSet.copyOf(diagParts);
}
 
Example #14
Source File: ArgTypeCompilerFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
ArgTypeDiagnosticFormatter(Options options) {
    super(null, new SimpleConfiguration(options,
            EnumSet.of(DiagnosticPart.SUMMARY,
            DiagnosticPart.DETAILS,
            DiagnosticPart.SUBDIAGNOSTICS)));
}
 
Example #15
Source File: ForwardingDiagnosticFormatter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void setVisible(Set<DiagnosticPart> diagParts) {
    configuration.setVisible(diagParts);
}
 
Example #16
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public boolean displaySource(JCDiagnostic d) {
    return config.getVisible().contains(DiagnosticPart.SOURCE) &&
            d.getType() != FRAGMENT &&
            d.getIntPosition() != Position.NOPOS;
}
 
Example #17
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void setVisible(Set<DiagnosticPart> diagParts) {
    visibleParts = EnumSet.copyOf(diagParts);
}
 
Example #18
Source File: ForwardingDiagnosticFormatter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void setVisible(Set<DiagnosticPart> diagParts) {
    configuration.setVisible(diagParts);
}
 
Example #19
Source File: ForwardingDiagnosticFormatter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Set<DiagnosticPart> getVisible() {
    return configuration.getVisible();
}
 
Example #20
Source File: AbstractDiagnosticFormatter.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public void setVisiblePart(DiagnosticPart diagParts, boolean enabled) {
    if (enabled)
        visibleParts.add(diagParts);
    else
        visibleParts.remove(diagParts);
}
 
Example #21
Source File: AbstractDiagnosticFormatter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public EnumSet<DiagnosticPart> getVisible() {
    return EnumSet.copyOf(visibleParts);
}
 
Example #22
Source File: AbstractDiagnosticFormatter.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public EnumSet<DiagnosticPart> getVisible() {
    return EnumSet.copyOf(visibleParts);
}
 
Example #23
Source File: AbstractDiagnosticFormatter.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("fallthrough")
public SimpleConfiguration(Options options, Set<DiagnosticPart> parts) {
    this(parts);
    String showSource = null;
    if ((showSource = options.get("showSource")) != null) {
        if (showSource.equals("true"))
            setVisiblePart(DiagnosticPart.SOURCE, true);
        else if (showSource.equals("false"))
            setVisiblePart(DiagnosticPart.SOURCE, false);
    }
    String diagOpts = options.get("diags");
    if (diagOpts != null) {//override -XDshowSource
        Collection<String> args = Arrays.asList(diagOpts.split(","));
        if (args.contains("short")) {
            setVisiblePart(DiagnosticPart.DETAILS, false);
            setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
        }
        if (args.contains("source"))
            setVisiblePart(DiagnosticPart.SOURCE, true);
        if (args.contains("-source"))
            setVisiblePart(DiagnosticPart.SOURCE, false);
    }
    String multiPolicy = null;
    if ((multiPolicy = options.get("multilinePolicy")) != null) {
        if (multiPolicy.equals("disabled"))
            setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
        else if (multiPolicy.startsWith("limit:")) {
            String limitString = multiPolicy.substring("limit:".length());
            String[] limits = limitString.split(":");
            try {
                switch (limits.length) {
                    case 2: {
                        if (!limits[1].equals("*"))
                            setMultilineLimit(MultilineLimit.DEPTH, Integer.parseInt(limits[1]));
                    }
                    case 1: {
                        if (!limits[0].equals("*"))
                            setMultilineLimit(MultilineLimit.LENGTH, Integer.parseInt(limits[0]));
                    }
                }
            }
            catch(NumberFormatException ex) {
                setMultilineLimit(MultilineLimit.DEPTH, -1);
                setMultilineLimit(MultilineLimit.LENGTH, -1);
            }
        }
    }
    String showCaret = null;
    if (((showCaret = options.get("showCaret")) != null) &&
        showCaret.equals("false"))
            setCaretEnabled(false);
    else
        setCaretEnabled(true);
}
 
Example #24
Source File: ArgTypeCompilerFactory.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
ArgTypeDiagnosticFormatter(Options options) {
    super(null, new SimpleConfiguration(options,
            EnumSet.of(DiagnosticPart.SUMMARY,
            DiagnosticPart.DETAILS,
            DiagnosticPart.SUBDIAGNOSTICS)));
}
 
Example #25
Source File: AbstractDiagnosticFormatter.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public boolean displaySource(JCDiagnostic d) {
    return config.getVisible().contains(DiagnosticPart.SOURCE) &&
            d.getType() != FRAGMENT &&
            d.getIntPosition() != Position.NOPOS;
}
 
Example #26
Source File: ArgTypeCompilerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
ArgTypeDiagnosticFormatter(Options options) {
    super(null, new SimpleConfiguration(options,
            EnumSet.of(DiagnosticPart.SUMMARY,
            DiagnosticPart.DETAILS,
            DiagnosticPart.SUBDIAGNOSTICS)));
}
 
Example #27
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void setVisiblePart(DiagnosticPart diagParts, boolean enabled) {
    if (enabled)
        visibleParts.add(diagParts);
    else
        visibleParts.remove(diagParts);
}
 
Example #28
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void setVisible(Set<DiagnosticPart> diagParts) {
    visibleParts = EnumSet.copyOf(diagParts);
}
 
Example #29
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public EnumSet<DiagnosticPart> getVisible() {
    return EnumSet.copyOf(visibleParts);
}
 
Example #30
Source File: AbstractDiagnosticFormatter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("fallthrough")
public SimpleConfiguration(Options options, Set<DiagnosticPart> parts) {
    this(parts);
    String showSource = null;
    if ((showSource = options.get("showSource")) != null) {
        if (showSource.equals("true"))
            setVisiblePart(DiagnosticPart.SOURCE, true);
        else if (showSource.equals("false"))
            setVisiblePart(DiagnosticPart.SOURCE, false);
    }
    String diagOpts = options.get("diags");
    if (diagOpts != null) {//override -XDshowSource
        Collection<String> args = Arrays.asList(diagOpts.split(","));
        if (args.contains("short")) {
            setVisiblePart(DiagnosticPart.DETAILS, false);
            setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
        }
        if (args.contains("source"))
            setVisiblePart(DiagnosticPart.SOURCE, true);
        if (args.contains("-source"))
            setVisiblePart(DiagnosticPart.SOURCE, false);
    }
    String multiPolicy = null;
    if ((multiPolicy = options.get("multilinePolicy")) != null) {
        if (multiPolicy.equals("disabled"))
            setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
        else if (multiPolicy.startsWith("limit:")) {
            String limitString = multiPolicy.substring("limit:".length());
            String[] limits = limitString.split(":");
            try {
                switch (limits.length) {
                    case 2: {
                        if (!limits[1].equals("*"))
                            setMultilineLimit(MultilineLimit.DEPTH, Integer.parseInt(limits[1]));
                    }
                    case 1: {
                        if (!limits[0].equals("*"))
                            setMultilineLimit(MultilineLimit.LENGTH, Integer.parseInt(limits[0]));
                    }
                }
            }
            catch(NumberFormatException ex) {
                setMultilineLimit(MultilineLimit.DEPTH, -1);
                setMultilineLimit(MultilineLimit.LENGTH, -1);
            }
        }
    }
    String showCaret = null;
    if (((showCaret = options.get("showCaret")) != null) &&
        showCaret.equals("false"))
            setCaretEnabled(false);
    else
        setCaretEnabled(true);
}