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


Java ApplyPatchStatus.SUCCESS屬性代碼示例

本文整理匯總了Java中com.intellij.openapi.diff.impl.patch.ApplyPatchStatus.SUCCESS屬性的典型用法代碼示例。如果您正苦於以下問題:Java ApplyPatchStatus.SUCCESS屬性的具體用法?Java ApplyPatchStatus.SUCCESS怎麽用?Java ApplyPatchStatus.SUCCESS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.openapi.diff.impl.patch.ApplyPatchStatus的用法示例。


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

示例1: getStatus

public ApplyPatchStatus getStatus() {
  if (! myNotExact.isEmpty()) {
    return ApplyPatchStatus.FAILURE;
  } else {
    if (myTransformations.isEmpty() && myHadAlreadyAppliedMet) return ApplyPatchStatus.ALREADY_APPLIED;
    boolean haveAlreadyApplied = myHadAlreadyAppliedMet;
    boolean haveTrue = false;
    for (MyAppliedData data : myTransformations.values()) {
      if (data.isHaveAlreadyApplied()) {
        haveAlreadyApplied |= true;
      } else {
        haveTrue = true;
      }
    }
    if (haveAlreadyApplied && ! haveTrue) return ApplyPatchStatus.ALREADY_APPLIED;
    if (haveAlreadyApplied) return ApplyPatchStatus.PARTIAL;
    return ApplyPatchStatus.SUCCESS;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:GenericPatchApplier.java

示例2: getStatus

public ApplyPatchStatus getStatus() {
  if (! myNotExact.isEmpty()) {
    return ApplyPatchStatus.FAILURE;
  } else {
    if (myTransformations.isEmpty() && myHadAlreadyAppliedMet) return ALREADY_APPLIED;
    boolean haveAlreadyApplied = myHadAlreadyAppliedMet;
    boolean haveTrue = false;
    for (MyAppliedData data : myTransformations.values()) {
      if (data.isHaveAlreadyApplied()) {
        haveAlreadyApplied |= true;
      } else {
        haveTrue = true;
      }
    }
    if (haveAlreadyApplied && ! haveTrue) return ALREADY_APPLIED;
    if (haveAlreadyApplied) return ApplyPatchStatus.PARTIAL;
    return ApplyPatchStatus.SUCCESS;
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:19,代碼來源:GenericPatchApplier.java

示例3: nonWriteActionPreCheck

public ApplyPatchStatus nonWriteActionPreCheck() {
  final boolean value = myVerifier.nonWriteActionPreCheck();
  if (! value) return ApplyPatchStatus.FAILURE;

  final List<FilePatch> skipped = myVerifier.getSkipped();
  final boolean applyAll = skipped.isEmpty();
  myPatches.removeAll(skipped);
  return applyAll ? ApplyPatchStatus.SUCCESS : ((skipped.size() == myPatches.size()) ? ApplyPatchStatus.ALREADY_APPLIED : ApplyPatchStatus.PARTIAL) ;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:PatchApplier.java

示例4: nonWriteActionPreCheck

@Nonnull
public ApplyPatchStatus nonWriteActionPreCheck() {
  final List<FilePatch> failedPreCheck = myVerifier.nonWriteActionPreCheck();
  myFailedPatches.addAll(failedPreCheck);
  myPatches.removeAll(failedPreCheck);
  final List<FilePatch> skipped = myVerifier.getSkipped();
  final boolean applyAll = skipped.isEmpty();
  myPatches.removeAll(skipped);
  if (!failedPreCheck.isEmpty()) return ApplyPatchStatus.FAILURE;
  return applyAll
         ? ApplyPatchStatus.SUCCESS
         : ((skipped.size() == myPatches.size()) ? ApplyPatchStatus.ALREADY_APPLIED : ApplyPatchStatus.PARTIAL);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:13,代碼來源:PatchApplier.java

示例5: createFiles

@Nonnull
private ApplyPatchStatus createFiles() {
  final Application application = ApplicationManager.getApplication();
  Boolean isSuccess = application.runWriteAction(new Computable<Boolean>() {
    @Override
    public Boolean compute() {
      final List<FilePatch> filePatches = myVerifier.execute();
      myFailedPatches.addAll(filePatches);
      myPatches.removeAll(filePatches);
      return myFailedPatches.isEmpty();
    }
  });
  return isSuccess ? ApplyPatchStatus.SUCCESS : ApplyPatchStatus.FAILURE;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:14,代碼來源:PatchApplier.java

示例6: tryApply

private ApplyPatchStatus tryApply(final List<String> lines, boolean acceptPartial) throws ApplyPatchException {
  final List<PatchLine> hunkLines = myHunk.getLines();
  ApplyPatchStatus result = null;
  int curLine = findStartLine(hunkLines, lines);
  for(PatchLine line: hunkLines) {
    final String patchLineText = line.getText();
    switch (line.getType()) {
      case CONTEXT:
        checkContextMismatch(lines, curLine, patchLineText);
        curLine++;
        break;

      case ADD:
        if (curLine < lines.size() && lines.get(curLine).equals(patchLineText) && acceptPartial) {
          result = ApplyPatchStatus.and(result, ApplyPatchStatus.ALREADY_APPLIED);
        }
        else {
          lines.add(curLine, patchLineText);
          result = ApplyPatchStatus.and(result, ApplyPatchStatus.SUCCESS);
        }
        curLine++;
        break;

      case REMOVE:
        if (curLine >= lines.size() || !patchLineText.equals(lines.get(curLine))) {
          if (acceptPartial) {
            // we'll get a context mismatch exception later if it's actually a conflict and not an already applied line
            result = ApplyPatchStatus.and(result, ApplyPatchStatus.ALREADY_APPLIED);
          }
          else {
            checkContextMismatch(lines, curLine, patchLineText);
          }
        }
        else {
          lines.remove(curLine);
          result = ApplyPatchStatus.and(result, ApplyPatchStatus.SUCCESS);
        }
        break;
    }
  }
  if (result != null) {
    return result;
  }
  return ApplyPatchStatus.SUCCESS;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:45,代碼來源:ApplyPatchHunk.java


注:本文中的com.intellij.openapi.diff.impl.patch.ApplyPatchStatus.SUCCESS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。