org.eclipse.ltk.core.refactoring.RefactoringStatus.merge()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.merge方法的一些代码示例,展示了RefactoringStatus.merge的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RefactoringStatus.merge方法的具体详情如下:
包路径:org.eclipse.ltk.core.refactoring.RefactoringStatus
类名称:RefactoringStatus
方法名:merge

RefactoringStatus.merge介绍

[英]Merges the receiver and the parameter statuses. The resulting list of entries in the receiver will contain entries from both. The resulting severity in the receiver will be the more severe of its current severity and the parameter's severity. Merging with null is allowed - it has no effect.
[中]合并接收器和参数状态。接收者中的结果条目列表将包含来自这两者的条目。接收器中的结果严重性将是其当前严重性和参数严重性中更严重的。允许与null合并-不起作用。

代码示例

代码示例来源:origin: eclipse/eclipse.jdt.ls

public ExtractTempRefactoring(JavaRefactoringArguments arguments, RefactoringStatus status) {
  this((ICompilationUnit) null, 0, 0);
  RefactoringStatus initializeStatus = initialize(arguments);
  status.merge(initializeStatus);
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

/**
 * Creates a new rename method processor from scripting arguments
 *
 * @param method the method, or <code>null</code> if invoked by scripting
 * @param arguments the arguments
 * @param status the resulting status
 */
public RenameNonVirtualMethodProcessor(IMethod method, JavaRefactoringArguments arguments, RefactoringStatus status) {
  this(method);
  RefactoringStatus initializeStatus= initialize(arguments);
  status.merge(initializeStatus);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public ExtractTempRefactoring(JavaRefactoringArguments arguments, RefactoringStatus status) {
    this((ICompilationUnit) null, 0, 0);
    RefactoringStatus initializeStatus= initialize(arguments);
    status.merge(initializeStatus);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public IntroduceParameterRefactoring(JavaRefactoringArguments arguments, RefactoringStatus status) {
    this(null, 0, 0);
    RefactoringStatus initializeStatus= initialize(arguments);
    status.merge(initializeStatus);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public PromoteTempToFieldRefactoring(JavaRefactoringArguments arguments, RefactoringStatus status) {
    this(null);
    RefactoringStatus initializeStatus= initialize(arguments);
    status.merge(initializeStatus);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public IntroduceFactoryRefactoring(JavaRefactoringArguments arguments, RefactoringStatus status) {
    this(null, 0, 0);
    RefactoringStatus initializeStatus= initialize(arguments);
    status.merge(initializeStatus);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public MoveStaticMembersProcessor(JavaRefactoringArguments arguments, RefactoringStatus status) {
  fDelegateUpdating= false;
  fDelegateDeprecation= true;
  RefactoringStatus initializeStatus= initialize(arguments);
  status.merge(initializeStatus);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private RefactoringStatus validatePage(boolean text) {
  RefactoringStatus result= new RefactoringStatus();
  if (text) {
    result.merge(validateMethodName());
    result.merge(validateParameters());
  } else {
    result.merge(validateParameters());
    result.merge(validateMethodName());
  }
  return result;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException {
  try{
    RefactoringStatus result= new RefactoringStatus();
    result.merge(checkClashesWithExistingFields());
    if (fInitializeIn == INITIALIZE_IN_CONSTRUCTOR)
      result.merge(checkClashesInConstructors());
    return result;
  } finally {
    pm.done();
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private RefactoringStatus checkNonAbstractMembersInDestinationClasses(IMember[] membersToPushDown, IType[] destinationClassesForNonAbstract) throws JavaModelException {
  RefactoringStatus result= new RefactoringStatus();
  List<IMember> list= new ArrayList<>(); // Arrays.asList does not support removing
  list.addAll(Arrays.asList(membersToPushDown));
  list.removeAll(Arrays.asList(getAbstractMembers(membersToPushDown)));
  IMember[] nonAbstractMembersToPushDown= list.toArray(new IMember[list.size()]);
  for (int i= 0; i < destinationClassesForNonAbstract.length; i++) {
    result.merge(MemberCheckUtil.checkMembersInDestinationType(nonAbstractMembersToPushDown, destinationClassesForNonAbstract[i]));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private RefactoringStatus checkAccessor(IProgressMonitor pm, IMethod existingAccessor, String newAccessorName) throws CoreException{
  RefactoringStatus result= new RefactoringStatus();
  result.merge(checkAccessorDeclarations(pm, existingAccessor));
  result.merge(checkNewAccessor(existingAccessor, newAccessorName));
  return result;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public final boolean visit(final SuperFieldAccess node) {
  Assert.isNotNull(node);
  fStatus.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.MoveInstanceMethodProcessor_uses_super, JavaStatusContext.create(fMethod.getCompilationUnit(), node)));
  fResult.add(node);
  return false;
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private RefactoringStatus checkTypeNameConflicts(IPackageFragmentRoot root, String newName, Set<String> topLevelTypeNames) throws CoreException {
  IPackageFragment otherPack= root.getPackageFragment(newName);
  if (fPackage.equals(otherPack)) {
    return null;
  }
  ICompilationUnit[] cus= otherPack.getCompilationUnits();
  RefactoringStatus result= new RefactoringStatus();
  for (int i= 0; i < cus.length; i++) {
    result.merge(checkTypeNameConflicts(cus[i], topLevelTypeNames));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

public RefactoringStatus checkActivationBasics(CompilationUnit rootNode) throws CoreException {
  RefactoringStatus result = new RefactoringStatus();
  fRootNode = rootNode;
  fAnalyzer = new SurroundWithTryCatchAnalyzer(fCUnit, fSelection);
  fRootNode.accept(fAnalyzer);
  result.merge(fAnalyzer.getStatus());
  ITypeBinding[] exceptions = fAnalyzer.getExceptions();
  if (fIsMultiCatch && (exceptions == null || exceptions.length <= 1)) {
    result.merge(RefactoringStatus.createWarningStatus(RefactoringCoreMessages.SurroundWithTryCatchRefactoring_notMultipleexceptions));
  }
  return result;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private RefactoringStatus checkAbstractMembersInDestinationClasses(IMember[] membersToPushDown, IType[] destinationClassesForAbstract) throws JavaModelException {
  RefactoringStatus result= new RefactoringStatus();
  IMember[] abstractMembersToPushDown= getAbstractMembers(membersToPushDown);
  for (int index= 0; index < destinationClassesForAbstract.length; index++) {
    result.merge(MemberCheckUtil.checkMembersInDestinationType(abstractMembersToPushDown, destinationClassesForAbstract[index]));
  }
  return result;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public RefactoringStatus checkActivationBasics(CompilationUnit rootNode) throws CoreException {
  RefactoringStatus result= new RefactoringStatus();
  fRootNode= rootNode;
  fAnalyzer= new SurroundWithTryCatchAnalyzer(fCUnit, fSelection);
  fRootNode.accept(fAnalyzer);
  result.merge(fAnalyzer.getStatus());
  ITypeBinding[] exceptions= fAnalyzer.getExceptions();
  if (fIsMultiCatch && (exceptions == null || exceptions.length <= 1)) {
    result.merge(RefactoringStatus.createWarningStatus(RefactoringCoreMessages.SurroundWithTryCatchRefactoring_notMultipleexceptions));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private RefactoringStatus analyzeCompilationUnits() throws CoreException {
  if (fOccurrences.length == 0) {
    return null;
  }
  RefactoringStatus result= new RefactoringStatus();
  fOccurrences= Checks.excludeCompilationUnits(fOccurrences, result);
  if (result.hasFatalError()) {
    return result;
  }
  result.merge(Checks.checkCompileErrorsInAffectedFiles(fOccurrences));
  return result;
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private RefactoringStatus analyzeAffectedCompilationUnits() throws CoreException{
  RefactoringStatus result= new RefactoringStatus();
  fReferences= Checks.excludeCompilationUnits(fReferences, result);
  if (result.hasFatalError()) {
    return result;
  }
  result.merge(Checks.checkCompileErrorsInAffectedFiles(fReferences));
  return result;
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

private RenameSupport(RenameJavaElementDescriptor descriptor) throws CoreException {
  RefactoringStatus refactoringStatus= new RefactoringStatus();
  fRefactoring= (RenameRefactoring) descriptor.createRefactoring(refactoringStatus);
  if (refactoringStatus.hasFatalError()) {
    fPreCheckStatus= refactoringStatus;
  } else {
    preCheck();
    refactoringStatus.merge(fPreCheckStatus);
    fPreCheckStatus= refactoringStatus;
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private RefactoringStatus checkClass() {
  RefactoringStatus status= new RefactoringStatus();
  IType type= fDescriptor.getType();
  if (!fDescriptor.isCreateTopLevel()) {
    if (type.getType(fDescriptor.getClassName()).exists()) {
      status.addError(Messages.format(RefactoringCoreMessages.ExtractClassRefactoring_errror_nested_name_clash, new Object[] { BasicElementLabels.getJavaElementName(fDescriptor.getClassName()), BasicElementLabels.getJavaElementName(type.getElementName()) }));
    }
  } else {
    status.merge(checkPackageClass());
  }
  return status;
}

相关文章