langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
changeset 45504 ea7475564d07
parent 43772 4e5350b7be75
child 45744 db6aedca2c8c
equal deleted inserted replaced
45503:d23ae2d67a5d 45504:ea7475564d07
  2146 
  2146 
  2147         /** A diagnostic object describing the failure
  2147         /** A diagnostic object describing the failure
  2148          */
  2148          */
  2149         public JCDiagnostic diag;
  2149         public JCDiagnostic diag;
  2150 
  2150 
  2151         /** A localized string describing the failure.
       
  2152          * @deprecated Use {@code getDetail()} or {@code getMessage()}
       
  2153          */
       
  2154         @Deprecated
       
  2155         public String errmsg;
       
  2156 
       
  2157         public CompletionFailure(Symbol sym, String errmsg) {
       
  2158             this.sym = sym;
       
  2159             this.errmsg = errmsg;
       
  2160 //          this.printStackTrace();//DEBUG
       
  2161         }
       
  2162 
       
  2163         public CompletionFailure(Symbol sym, JCDiagnostic diag) {
  2151         public CompletionFailure(Symbol sym, JCDiagnostic diag) {
  2164             this.sym = sym;
  2152             this.sym = sym;
  2165             this.diag = diag;
  2153             this.diag = diag;
  2166 //          this.printStackTrace();//DEBUG
  2154 //          this.printStackTrace();//DEBUG
  2167         }
  2155         }
  2170             return diag;
  2158             return diag;
  2171         }
  2159         }
  2172 
  2160 
  2173         @Override
  2161         @Override
  2174         public String getMessage() {
  2162         public String getMessage() {
  2175             if (diag != null)
  2163             return diag.getMessage(null);
  2176                 return diag.getMessage(null);
  2164         }
  2177             else
  2165 
  2178                 return errmsg;
  2166         public JCDiagnostic getDetailValue() {
  2179         }
  2167             return diag;
  2180 
       
  2181         public Object getDetailValue() {
       
  2182             return (diag != null ? diag : errmsg);
       
  2183         }
  2168         }
  2184 
  2169 
  2185         @Override
  2170         @Override
  2186         public CompletionFailure initCause(Throwable cause) {
  2171         public CompletionFailure initCause(Throwable cause) {
  2187             super.initCause(cause);
  2172             super.initCause(cause);