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


Java IProblem.ImportNotFound方法代碼示例

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


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

示例1: determineUnresolvableImports

import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
private static Collection<ImportDeclaration> determineUnresolvableImports(CompilationUnit cu) {
	Collection<ImportDeclaration> unresolvableImports= new ArrayList<>(cu.imports().size());
	for (IProblem problem : cu.getProblems()) {
		if (problem.getID() == IProblem.ImportNotFound) {
			ImportDeclaration problematicImport= getProblematicImport(problem, cu);
			if (problematicImport != null) {
				unresolvableImports.add(problematicImport);
			}
		}
	}

	return unresolvableImports;
}
 
開發者ID:eclipse,項目名稱:eclipse.jdt.ls,代碼行數:14,代碼來源:OrganizeImportsOperation.java

示例2: isUnusedImport

import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
public static boolean isUnusedImport(IProblemLocation problem) {
  int id = problem.getProblemId();
  return id == IProblem.UnusedImport
      || id == IProblem.DuplicateImport
      || id == IProblem.ConflictingImport
      || id == IProblem.CannotImportPackage
      || id == IProblem.ImportNotFound;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:9,代碼來源:UnusedCodeFix.java

示例3: computeNumberOfFixes

import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public int computeNumberOfFixes(CompilationUnit compilationUnit) {
  int result = 0;
  IProblem[] problems = compilationUnit.getProblems();
  if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_IMPORTS)
      && !isEnabled(CleanUpConstants.ORGANIZE_IMPORTS)) {
    for (int i = 0; i < problems.length; i++) {
      int id = problems[i].getID();
      if (id == IProblem.UnusedImport
          || id == IProblem.DuplicateImport
          || id == IProblem.ConflictingImport
          || id == IProblem.CannotImportPackage
          || id == IProblem.ImportNotFound) result++;
    }
  }
  if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
      && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS))
    result += getNumberOfProblems(problems, IProblem.UnusedPrivateMethod);
  if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
      && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS))
    result += getNumberOfProblems(problems, IProblem.UnusedPrivateConstructor);
  if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
      && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES))
    result += getNumberOfProblems(problems, IProblem.UnusedPrivateType);
  if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
      && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS))
    result += getNumberOfProblems(problems, IProblem.UnusedPrivateField);
  if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES))
    result += getNumberOfProblems(problems, IProblem.LocalVariableIsNeverUsed);
  return result;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:33,代碼來源:UnusedCodeCleanUp.java

示例4: isUnusedImport

import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
public static boolean isUnusedImport(IProblemLocation problem) {
	int id= problem.getProblemId();
	return id == IProblem.UnusedImport || id == IProblem.DuplicateImport || id == IProblem.ConflictingImport || id == IProblem.CannotImportPackage || id == IProblem.ImportNotFound;
}
 
開發者ID:eclipse,項目名稱:eclipse.jdt.ls,代碼行數:5,代碼來源:UnusedCodeFix.java


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