/** * Adds a <code>WARNING</code> entry filled with the given message to this status. * If the current severity is <code>OK</code> or <code>INFO</code> it will be * changed to <code>WARNING</code>. It will remain unchanged otherwise. * * @param msg the message of the warning entry * * @see RefactoringStatusEntry */ public void addWarning(String msg) { addWarning(msg, null); }
/** * Adds a <code>WARNING</code> entry filled with the given message to this status. * If the current severity is <code>OK</code> or <code>INFO</code> it will be * changed to <code>WARNING</code>. It will remain unchanged otherwise. * * @param msg the message of the warning entry * * @see RefactoringStatusEntry */ public void addWarning(String msg) { addWarning(msg, null); }
private void checkMissingKeys(RefactoringStatus status) { for (int i= 0; i < fSubstitutions.length; i++) { NLSSubstitution substitution= fSubstitutions[i]; if ((substitution.getValue() == null) && (substitution.getKey() != null)) { status.addWarning(NLSUIMessages.ExternalizeWizardPage_warning_keymissing); return; } } }
private void checkMissingKeys(RefactoringStatus status) { for (int i= 0; i < fSubstitutions.length; i++) { NLSSubstitution substitution= fSubstitutions[i]; if ((substitution.getValue() == null) && (substitution.getKey() != null)) { status.addWarning(NLSUIMessages.ExternalizeWizardPage_warning_keymissing); return; } } }
public RefactoringStatus checkTempName(String newName) { RefactoringStatus status= Checks.checkTempName(newName); if (Arrays.asList(getExcludedVariableNames()).contains(newName)) status.addWarning(Messages.format(RefactoringCoreMessages.ExtractTempRefactoring_another_variable, newName)); return status; }
private RefactoringStatus createWarning(Exception e) { RefactoringStatus result= new RefactoringStatus(); result.addWarning(Messages.format(FixMessages.PotentialProgrammingProblemsFix_calculatingUIDFailed_exception, new String[] {fProject.getElementName(), e.getLocalizedMessage()}), new RefactoringStatusContext() { public Object getCorrespondingElement() { return fProject; } }); return result; }
public RefactoringStatus checkTempName(String newName) { RefactoringStatus status = Checks.checkTempName(newName, fCu); if (Arrays.asList(getExcludedVariableNames()).contains(newName)) { status.addWarning(Messages.format(RefactoringCoreMessages.ExtractTempRefactoring_another_variable, BasicElementLabels.getJavaElementName(newName))); } return status; }
public RefactoringStatus checkTempName(String newName) { RefactoringStatus status= Checks.checkTempName(newName, fCu); if (Arrays.asList(getExcludedVariableNames()).contains(newName)) status.addWarning(Messages.format(RefactoringCoreMessages.ExtractTempRefactoring_another_variable, BasicElementLabels.getJavaElementName(newName))); return status; }
public RefactoringStatus checkTempName(String newName) { RefactoringStatus status= Checks.checkTempName(newName, fCu); if (Arrays.asList(getExcludedVariableNames()).contains(newName)) status.addWarning(Messages.format(RefactoringCoreMessages.ExtractTempRefactoring_another_variable, BasicElementLabels.getJavaElementName(newName))); return status; }
@Override public RefactoringStatus checkConditions() { RefactoringStatus status= super.checkConditions(); if (fContext.isCustomArray() || fContext.isLimitItems()) status.addWarning(CodeGenerationMessages.GenerateToStringOperation_warning_no_arrays_collections_with_this_style); return status; }
public static RefactoringStatus checkTempName(String newName) { RefactoringStatus result= Checks.checkIdentifier(newName); if (result.hasFatalError()) return result; if (! Checks.startsWithLowerCase(newName)) result.addWarning(RefactoringCoreMessages.ExtractTempRefactoring_convention); return result; }
public static RefactoringStatus checkTempName(String newName, IJavaElement context) { RefactoringStatus result= Checks.checkIdentifier(newName, context); if (result.hasFatalError()) return result; if (! Checks.startsWithLowerCase(newName)) result.addWarning(RefactoringCoreMessages.ExtractTempRefactoring_convention); return result; }
public static RefactoringStatus checkTempName(String newName, IJavaElement context) { RefactoringStatus result= Checks.checkIdentifier(newName, context); if (result.hasFatalError()) return result; if (! Checks.startsWithLowerCase(newName)) result.addWarning(RefactoringCoreMessages.ExtractTempRefactoring_convention); return result; }
public RefactoringStatus checkNewElementName(String newName) throws JavaModelException { RefactoringStatus result= Checks.checkFieldName(newName); if (! Checks.startsWithLowerCase(newName)) if (fIsComposite) { final String nameOfParent= (fLocalVariable.getParent() instanceof IMethod) ? fLocalVariable.getParent().getElementName() : RefactoringCoreMessages.JavaElementUtil_initializer; final String nameOfType= fLocalVariable.getAncestor(IJavaElement.TYPE).getElementName(); result.addWarning(Messages.format(RefactoringCoreMessages.RenameTempRefactoring_lowercase2, new String[] { newName, nameOfParent, nameOfType })); } else { result.addWarning(RefactoringCoreMessages.RenameTempRefactoring_lowercase); } return result; }
public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException { fChange= createTextChange(pm); RefactoringStatus result= new RefactoringStatus(); if (Arrays.asList(getExcludedVariableNames()).contains(fTempName)) result.addWarning(Messages.format(RefactoringCoreMessages.ExtractTempRefactoring_another_variable, fTempName)); result.merge(checkMatchingFragments()); fChange.setKeepPreviewEdits(true); checkNewSource(result); return result; }
private void checkCompileErrors(RefactoringStatus result, CompilationUnit root, ICompilationUnit element) { IProblem[] messages = root.getProblems(); for (int i = 0; i < messages.length; i++) { IProblem problem = messages[i]; if (!isIgnorableProblem(problem)) { result.addWarning(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_compiler_errors_update, BasicElementLabels.getFileName(element)), JavaStatusContext.create(element)); return; } } }
private void checkCompileErrors(RefactoringStatus result, CompilationUnit root, ICompilationUnit element) { IProblem[] messages= root.getProblems(); for (int i= 0; i < messages.length; i++) { IProblem problem= messages[i]; if (!isIgnorableProblem(problem)) { result.addWarning(Messages.format( RefactoringCoreMessages.SelfEncapsulateField_compiler_errors_update, BasicElementLabels.getFileName(element)), JavaStatusContext.create(element)); return; } } }
private void checkCompileErrors(RefactoringStatus result, CompilationUnit root, ICompilationUnit element) { IProblem[] messages= root.getProblems(); for (int i= 0; i < messages.length; i++) { IProblem problem= messages[i]; if (!isIgnorableProblem(problem)) { result.addWarning(Messages.format( RefactoringCoreMessages.SelfEncapsulateField_compiler_errors_update, BasicElementLabels.getFileName(element)), JavaStatusContext.create(element)); return; } } }
private RefactoringStatus checkMatchingFragments() throws JavaModelException { RefactoringStatus result = new RefactoringStatus(); IASTFragment[] matchingFragments = getMatchingFragments(); for (int i = 0; i < matchingFragments.length; i++) { ASTNode node = matchingFragments[i].getAssociatedNode(); if (isLeftValue(node) && !isReferringToLocalVariableFromFor((Expression) node)) { String msg = RefactoringCoreMessages.ExtractTempRefactoring_assigned_to; result.addWarning(msg, JavaStatusContext.create(fCu, node)); } } return result; }
private RefactoringStatus checkMatchingFragments() throws JavaModelException { RefactoringStatus result= new RefactoringStatus(); IASTFragment[] matchingFragments= getMatchingFragments(); for (int i= 0; i < matchingFragments.length; i++) { ASTNode node= matchingFragments[i].getAssociatedNode(); if (isLeftValue(node) && !isReferringToLocalVariableFromFor((Expression) node)) { String msg= RefactoringCoreMessages.ExtractTempRefactoring_assigned_to; result.addWarning(msg, JavaStatusContext.create(fCu, node)); } } return result; }