コード例 #1
0
 @Override
 public String visitCapturedType(CapturedType t, Locale locale) {
   if (!allCaptured.contains(t)) {
     allCaptured = allCaptured.append(t);
   }
   return super.visitCapturedType(t, locale);
 }
コード例 #2
0
 /**
  * Format all the subdiagnostics attached to a given diagnostic.
  *
  * @param d diagnostic whose subdiagnostics are to be formatted
  * @param l locale object to be used for i18n
  * @return list of all string representations of the subdiagnostics
  */
 protected List<String> formatSubdiagnostics(JCDiagnostic d, Locale l) {
   List<String> subdiagnostics = List.nil();
   int maxDepth = config.getMultilineLimit(MultilineLimit.DEPTH);
   if (maxDepth == -1 || depth < maxDepth) {
     depth++;
     try {
       int maxCount = config.getMultilineLimit(MultilineLimit.LENGTH);
       int count = 0;
       for (JCDiagnostic d2 : d.getSubdiagnostics()) {
         if (maxCount == -1 || count < maxCount) {
           subdiagnostics = subdiagnostics.append(formatSubdiagnostic(d, d2, l));
           count++;
         } else break;
       }
     } finally {
       depth--;
     }
   }
   return subdiagnostics;
 }