src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
changeset 49876 ac916fea6ec7
parent 49872 0798eab12791
child 50218 0df902a00215
equal deleted inserted replaced
49875:6d1f26b1ddfd 49876:ac916fea6ec7
   136     public static class InferenceException extends InapplicableMethodException {
   136     public static class InferenceException extends InapplicableMethodException {
   137         private static final long serialVersionUID = 0;
   137         private static final long serialVersionUID = 0;
   138 
   138 
   139         List<JCDiagnostic> messages = List.nil();
   139         List<JCDiagnostic> messages = List.nil();
   140 
   140 
   141         InferenceException(JCDiagnostic.Factory diags) {
   141         InferenceException() {
   142             super(diags);
   142             super(null);
   143         }
       
   144 
       
   145         @Override
       
   146         InapplicableMethodException setMessage() {
       
   147             throw new AssertionError("InferenceException is immutable");
       
   148         }
       
   149 
       
   150         @Override
       
   151         InapplicableMethodException setMessage(JCDiagnostic diag) {
       
   152             throw new AssertionError("InferenceException is immutable");
       
   153         }
       
   154 
       
   155         @Override
       
   156         InapplicableMethodException setMessage(String key, Object... args) {
       
   157             throw new AssertionError("InferenceException is immutable");
       
   158         }
   143         }
   159 
   144 
   160         @Override
   145         @Override
   161         public JCDiagnostic getDiagnostic() {
   146         public JCDiagnostic getDiagnostic() {
   162             return messages.head;
   147             return messages.head;
   163         }
   148         }
   164     }
   149     }
   165 
   150 
   166     InferenceException error(JCDiagnostic diag) {
   151     InferenceException error(JCDiagnostic diag) {
   167         InferenceException result = new InferenceException(diags);
   152         InferenceException result = new InferenceException();
   168         if (diag != null) {
   153         if (diag != null) {
   169             result.messages = result.messages.append(diag);
   154             result.messages = result.messages.append(diag);
   170         }
   155         }
   171         return result;
   156         return result;
   172     }
   157     }