/** * Creates a new <code>RefactoringStatus</code> with one <code>INFO</code> entry * filled with the given message. * * @param msg the message of the info entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createInfoStatus(String msg) { return createStatus(INFO, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>FATAL</code> entry * filled with the given message. * * @param msg the message of the fatal entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createFatalErrorStatus(String msg) { return createStatus(FATAL, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>FATAL</code> entry * filled with the given message. * * @param msg the message of the fatal entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createFatalErrorStatus(String msg) { return createStatus(FATAL, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>WARNING</code> entry * filled with the given message. * * @param msg the message of the warning entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createWarningStatus(String msg) { return createStatus(WARNING, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>WARNING</code> entry * filled with the given message. * * @param msg the message of the warning entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createWarningStatus(String msg) { return createStatus(WARNING, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>ERROR</code> entry * filled with the given message. * * @param msg the message of the error entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createErrorStatus(String msg) { return createStatus(ERROR, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>ERROR</code> entry * filled with the given message. * * @param msg the message of the error entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createErrorStatus(String msg) { return createStatus(ERROR, msg, null, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a <code>RefactoringStatus</code> with one <code>FATAL</code> entry * fill with the given message and context. * * @param msg the message of the fatal entry * @param context the context of the fatal entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createFatalErrorStatus(String msg, RefactoringStatusContext context) { return createStatus(FATAL, msg, context, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a <code>RefactoringStatus</code> with one <code>WARNING</code> entry * fill with the given message and context. * * @param msg the message of the warning entry * @param context the context of the warning entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createWarningStatus(String msg, RefactoringStatusContext context) { return createStatus(WARNING, msg, context, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a new <code>RefactoringStatus</code> with one <code>INFO</code> entry * filled with the given message and context. * * @param msg the message of the info entry * @param context the context of the info entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createInfoStatus(String msg, RefactoringStatusContext context) { return createStatus(INFO, msg, context, null, RefactoringStatusEntry.NO_CODE, null); }
/** * Creates a <code>RefactoringStatus</code> with one <code>WARNING</code> entry * fill with the given message and context. * * @param msg the message of the warning entry * @param context the context of the warning entry * @return the refactoring status * * @see RefactoringStatusEntry */ public static RefactoringStatus createWarningStatus(String msg, RefactoringStatusContext context) { return createStatus(WARNING, msg, context, null, RefactoringStatusEntry.NO_CODE, null); }
public RefactoringStatus checkStaticFinalConstantNameSelected() { if (fSelectedConstantName == null) return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.InlineConstantRefactoring_static_final_field, null, Corext.getPluginId(), RefactoringStatusCodes.NOT_STATIC_FINAL_SELECTED, null); return new RefactoringStatus(); }
private RefactoringStatus checkExpressionFragmentIsRValue() { switch(Checks.checkExpressionIsRValue(fSelectedExpression)) { case Checks.NOT_RVALUE_MISC: return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_select, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE, null); case Checks.NOT_RVALUE_VOID: return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_no_void, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID, null); case Checks.IS_RVALUE: return new RefactoringStatus(); default: Assert.isTrue(false); return null; } }
private RefactoringStatus checkExpressionFragmentIsRValue() { switch(Checks.checkExpressionIsRValue(fSelectedExpression)) { case Checks.IS_RVALUE_GUESSED: case Checks.NOT_RVALUE_MISC: return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_select, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE, null); case Checks.NOT_RVALUE_VOID: return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_no_void, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID, null); case Checks.IS_RVALUE: return new RefactoringStatus(); default: Assert.isTrue(false); return null; } }
private RefactoringStatus checkExpressionFragmentIsRValue() { switch(Checks.checkExpressionIsRValue(fSelectedExpression)) { case Checks.IS_RVALUE_GUESSED: case Checks.NOT_RVALUE_MISC: return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_select, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE, null); case Checks.NOT_RVALUE_VOID: return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_no_void, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID, null); case Checks.IS_RVALUE: return new RefactoringStatus(); default: Assert.isTrue(false); return null; } }
private RefactoringStatus findField() throws JavaModelException { fField= (IField) ((IVariableBinding) fSelectedConstantName.resolveBinding()).getJavaElement(); if (fField != null && ! fField.exists()) return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.InlineConstantRefactoring_local_anonymous_unsupported, null, Corext.getPluginId(), RefactoringStatusCodes.LOCAL_AND_ANONYMOUS_NOT_SUPPORTED, null); return null; } private RefactoringStatus findDeclaration() throws JavaModelException {
private RefactoringStatus checkInitializer() { Expression initializer= getInitializer(); if (initializer == null) return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.InlineConstantRefactoring_blank_finals, null, Corext.getPluginId(), RefactoringStatusCodes.CANNOT_INLINE_BLANK_FINAL, null); fInitializerAllStaticFinal= ConstantChecks.isStaticFinalConstant((IExpressionFragment) ASTFragmentFactory.createFragmentForFullSubtree(initializer)); fInitializerChecked= true; return new RefactoringStatus(); }
private RefactoringStatus checkInitializer() { Expression initializer= getInitializer(); if (initializer == null) return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.InlineConstantRefactoring_blank_finals, null, Corext.getPluginId(), RefactoringStatusCodes.CANNOT_INLINE_BLANK_FINAL, null); fInitializerAllStaticFinal= ConstantChecks.isStaticFinalConstant((IExpressionFragment) ASTFragmentFactory.createFragmentForFullSubtree(initializer)); fInitializerChecked= true; return new RefactoringStatus(); }
public static RefactoringStatus checkIfOverridesAnother(IMethod method, ITypeHierarchy hierarchy) throws JavaModelException { IMethod overrides= MethodChecks.overridesAnotherMethod(method, hierarchy); if (overrides == null) { return null; } RefactoringStatusContext context= JavaStatusContext.create(overrides); String message= Messages.format(RefactoringCoreMessages.MethodChecks_overrides, new String[]{JavaElementUtil.createMethodSignature(overrides), JavaElementLabels.getElementLabel(overrides.getDeclaringType(), JavaElementLabels.ALL_FULLY_QUALIFIED)}); return RefactoringStatus.createStatus(RefactoringStatus.FATAL, message, context, "", RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD, overrides); }
public static RefactoringStatus checkIfOverridesAnother(IMethod method, ITypeHierarchy hierarchy) throws JavaModelException { IMethod overrides= MethodChecks.overridesAnotherMethod(method, hierarchy); if (overrides == null) return null; RefactoringStatusContext context= JavaStatusContext.create(overrides); String message= Messages.format(RefactoringCoreMessages.MethodChecks_overrides, new String[]{JavaElementUtil.createMethodSignature(overrides), JavaElementLabels.getElementLabel(overrides.getDeclaringType(), JavaElementLabels.ALL_FULLY_QUALIFIED)}); return RefactoringStatus.createStatus(RefactoringStatus.FATAL, message, context, Corext.getPluginId(), RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD, overrides); }