當前位置: 首頁>>代碼示例>>Java>>正文


Java IProblem.RedundantNullDefaultAnnotationPackage方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.compiler.IProblem.RedundantNullDefaultAnnotationPackage方法的典型用法代碼示例。如果您正苦於以下問題:Java IProblem.RedundantNullDefaultAnnotationPackage方法的具體用法?Java IProblem.RedundantNullDefaultAnnotationPackage怎麽用?Java IProblem.RedundantNullDefaultAnnotationPackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.compiler.IProblem的用法示例。


在下文中一共展示了IProblem.RedundantNullDefaultAnnotationPackage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createRemoveRedundantNullAnnotationsOperations

import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
private static void createRemoveRedundantNullAnnotationsOperations(
    CompilationUnit compilationUnit,
    IProblemLocation[] locations,
    List<CompilationUnitRewriteOperation> result) {
  for (int i = 0; i < locations.length; i++) {
    IProblemLocation problem = locations[i];
    if (problem == null) continue; // problem was filtered out by createCleanUp()

    int problemId = problem.getProblemId();
    if (problemId == IProblem.RedundantNullAnnotation
        || problemId == IProblem.RedundantNullDefaultAnnotationPackage
        || problemId == IProblem.RedundantNullDefaultAnnotationType
        || problemId == IProblem.RedundantNullDefaultAnnotationMethod) {
      RemoveRedundantAnnotationRewriteOperation operation =
          new RemoveRedundantAnnotationRewriteOperation(compilationUnit, problem);
      result.add(operation);
    }
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:20,代碼來源:NullAnnotationsFix.java

示例2: getStepDescriptions

import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public String[] getStepDescriptions() {
  List<String> result = new ArrayList<String>();
  switch (this.handledProblemID) {
    case IProblem.NonNullLocalVariableComparisonYieldsFalse:
    case IProblem.RedundantNullCheckOnNonNullLocalVariable:
    case IProblem.RequiredNonNullButProvidedNull:
    case IProblem.RequiredNonNullButProvidedPotentialNull:
    case IProblem.RequiredNonNullButProvidedSpecdNullable:
    case IProblem.RequiredNonNullButProvidedUnknown:
    case IProblem.IllegalDefinitionToNonNullParameter:
    case IProblem.IllegalRedefinitionToNonNullParameter:
    case IProblem.ParameterLackingNullableAnnotation:
      result.add(MultiFixMessages.NullAnnotationsCleanUp_add_nullable_annotation);
      break;
    case IProblem.ParameterLackingNonNullAnnotation:
      result.add(MultiFixMessages.NullAnnotationsCleanUp_add_nonnull_annotation);
      break;
    case IProblem.RedundantNullAnnotation:
    case IProblem.RedundantNullDefaultAnnotationPackage:
    case IProblem.RedundantNullDefaultAnnotationType:
    case IProblem.RedundantNullDefaultAnnotationMethod:
      result.add(MultiFixMessages.NullAnnotationsCleanUp_remove_redundant_nullness_annotation);
      break;
  }
  return result.toArray(new String[result.size()]);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:29,代碼來源:NullAnnotationsCleanUp.java


注:本文中的org.eclipse.jdt.core.compiler.IProblem.RedundantNullDefaultAnnotationPackage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。