Java Code Examples for com.sun.tools.javac.util.JCDiagnostic#MultilineDiagnostic
The following examples show how to use
com.sun.tools.javac.util.JCDiagnostic#MultilineDiagnostic .
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: StructuralMostSpecificTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 2
Source File: StructuralMostSpecificTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 3
Source File: StructuralMostSpecificTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 4
Source File: StructuralMostSpecificTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 5
Source File: StructuralMostSpecificTest.java From hottub with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 6
Source File: StructuralMostSpecificTest.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 7
Source File: StructuralMostSpecificTest.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { try { if (diagnostic.getKind() == Diagnostic.Kind.ERROR && diagnostic.getCode().equals("compiler.err.ref.ambiguous")) { ambiguityFound = true; } else if (diagnostic.getKind() == Diagnostic.Kind.NOTE && diagnostic.getCode() .equals("compiler.note.verbose.resolve.multi")) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; mostSpecificSig = ((JCDiagnostic)mdiag.getSubdiagnostics() .get(mostSpecificIndex)).getArgs()[1].toString(); } } catch (RuntimeException t) { t.printStackTrace(); throw t; } }
Example 8
Source File: ResolveHarness.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 9
Source File: ResolveHarness.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 10
Source File: ResolveHarness.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 11
Source File: ResolveHarness.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 12
Source File: StructuralMostSpecificTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
String mostSpecificSignature(Result<Iterable<? extends Element>> result) { List<Diagnostic<? extends JavaFileObject>> rsDiag = result.diagnosticsForKey("compiler.note.verbose.resolve.multi"); if (rsDiag.nonEmpty()) { ClientCodeWrapper.DiagnosticSourceUnwrapper dsu = (ClientCodeWrapper.DiagnosticSourceUnwrapper)rsDiag.head; JCDiagnostic.MultilineDiagnostic mdiag = (JCDiagnostic.MultilineDiagnostic)dsu.d; int mostSpecificIndex = (Integer)mdiag.getArgs()[2]; return mdiag.getSubdiagnostics().get(mostSpecificIndex).getArgs()[1].toString(); } else { return null; } }
Example 13
Source File: ResolveHarness.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 14
Source File: ResolveHarness.java From hottub with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 15
Source File: ResolveHarness.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }
Example 16
Source File: ResolveHarness.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
List<JCDiagnostic> subDiagnostics(Diagnostic<? extends JavaFileObject> diagnostic) { JCDiagnostic diag = asJCDiagnostic(diagnostic); if (diag instanceof JCDiagnostic.MultilineDiagnostic) { return ((JCDiagnostic.MultilineDiagnostic)diag).getSubdiagnostics(); } else { throw new AssertionError("Cannot extract subdiagnostics: " + diag.getClass().getName()); } }