Java Code Examples for org.eclipse.ltk.core.refactoring.RefactoringStatus#createFatalErrorStatus()

The following examples show how to use org.eclipse.ltk.core.refactoring.RefactoringStatus#createFatalErrorStatus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InlineTempRefactoring.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private RefactoringStatus checkSelection(VariableDeclaration decl) {
	ASTNode parent= decl.getParent();
	if (parent instanceof MethodDeclaration) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InlineTempRefactoring_method_parameter);
	}

	if (parent instanceof CatchClause) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InlineTempRefactoring_exceptions_declared);
	}

	if (parent instanceof VariableDeclarationExpression && parent.getLocationInParent() == ForStatement.INITIALIZERS_PROPERTY) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InlineTempRefactoring_for_initializers);
	}

	if (parent instanceof VariableDeclarationExpression && parent.getLocationInParent() == TryStatement.RESOURCES_PROPERTY) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InlineTempRefactoring_resource_in_try_with_resources);
	}

	if (decl.getInitializer() == null) {
		String message= Messages.format(RefactoringCoreMessages.InlineTempRefactoring_not_initialized, BasicElementLabels.getJavaElementName(decl.getName().getIdentifier()));
		return RefactoringStatus.createFatalErrorStatus(message);
	}

	return checkAssignments(decl);
}
 
Example 2
Source File: ExtractConstantRefactoring.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
private RefactoringStatus checkExpression() throws JavaModelException {
	RefactoringStatus result = new RefactoringStatus();
	result.merge(checkExpressionBinding());
	if (result.hasFatalError()) {
		return result;
	}
	checkAllStaticFinal();

	IExpressionFragment selectedExpression = getSelectedExpression();
	Expression associatedExpression = selectedExpression.getAssociatedExpression();
	if (associatedExpression instanceof NullLiteral) {
		result.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractConstantRefactoring_null_literals));
	} else if (!ConstantChecks.isLoadTimeConstant(selectedExpression)) {
		result.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractConstantRefactoring_not_load_time_constant));
	} else if (associatedExpression instanceof SimpleName) {
		if (associatedExpression.getParent() instanceof QualifiedName && associatedExpression.getLocationInParent() == QualifiedName.NAME_PROPERTY
				|| associatedExpression.getParent() instanceof FieldAccess && associatedExpression.getLocationInParent() == FieldAccess.NAME_PROPERTY) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractConstantRefactoring_select_expression);
		}
	}

	return result;
}
 
Example 3
Source File: ReorgPolicyFactory.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected RefactoringStatus verifyDestination(IResource resource) throws JavaModelException {
	Assert.isNotNull(resource);
	if (!resource.exists() || resource.isPhantom()) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_phantom);
	}
	if (!resource.isAccessible()) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_inaccessible);
	}

	if (resource.getType() == IResource.ROOT) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (isChildOfOrEqualToAnyFolder(resource)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (containsLinkedResources() && !ReorgUtils.canBeDestinationForLinkedResources(resource)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_linked);
	}

	return new RefactoringStatus();
}
 
Example 4
Source File: RenameSourceFolderProcessor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public RefactoringStatus checkNewElementName(String newName) throws CoreException {
	Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
	if (! newName.trim().equals(newName))
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameSourceFolderRefactoring_blank);

	IContainer c= 	fSourceFolder.getResource().getParent();
	if (! c.getFullPath().isValidSegment(newName))
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameSourceFolderRefactoring_invalid_name);

	RefactoringStatus result= RefactoringStatus.create(c.getWorkspace().validateName(newName, IResource.FOLDER));
	if (result.hasFatalError())
		return result;

	result.merge(RefactoringStatus.create(c.getWorkspace().validatePath(createNewPath(newName), IResource.FOLDER)));
	if (result.hasFatalError())
		return result;

	IJavaProject project= fSourceFolder.getJavaProject();
	IPath p= project.getProject().getFullPath().append(newName);
	if (project.findPackageFragmentRoot(p) != null)
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameSourceFolderRefactoring_already_exists);

	if (project.getProject().findMember(new Path(newName)) != null)
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameSourceFolderRefactoring_alread_exists);
	return result;
}
 
Example 5
Source File: InlineTempRefactoring.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private RefactoringStatus checkAssignments(VariableDeclaration decl) {
	TempAssignmentFinder assignmentFinder= new TempAssignmentFinder(decl);
	getASTRoot().accept(assignmentFinder);
	if (!assignmentFinder.hasAssignments())
		return new RefactoringStatus();
	ASTNode firstAssignment= assignmentFinder.getFirstAssignment();
	int start= firstAssignment.getStartPosition();
	int length= firstAssignment.getLength();
	ISourceRange range= new SourceRange(start, length);
	RefactoringStatusContext context= JavaStatusContext.create(fCu, range);
	String message= Messages.format(RefactoringCoreMessages.InlineTempRefactoring_assigned_more_once, BasicElementLabels.getJavaElementName(decl.getName().getIdentifier()));
	return RefactoringStatus.createFatalErrorStatus(message, context);
}
 
Example 6
Source File: InlineTempRefactoring.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public RefactoringStatus checkIfTempSelected() {
	VariableDeclaration decl= getVariableDeclaration();
	if (decl == null) {
		return CodeRefactoringUtil.checkMethodSyntaxErrors(fSelectionStart, fSelectionLength, getASTRoot(), RefactoringCoreMessages.InlineTempRefactoring_select_temp);
	}
	if (decl.getParent() instanceof FieldDeclaration) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InlineTemRefactoring_error_message_fieldsCannotBeInlined);
	}
	return new RefactoringStatus();
}
 
Example 7
Source File: ReorgPolicyFactory.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected RefactoringStatus verifyDestination(IResource resource) {
	Assert.isNotNull(resource);
	if (!resource.exists() || resource.isPhantom()) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_phantom);
	}
	if (!resource.isAccessible()) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_inaccessible);
	}

	if (!(resource instanceof IContainer)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (resource.getType() == IResource.ROOT) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (isChildOfOrEqualToAnyFolder(resource)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (containsLinkedResources() && !ReorgUtils.canBeDestinationForLinkedResources(resource)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_linked);
	}

	return new RefactoringStatus();
}
 
Example 8
Source File: ExtractFieldRefactoring.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
private RefactoringStatus checkExpression() throws JavaModelException {
	Expression selectedExpression = getSelectedExpression().getAssociatedExpression();
	if (selectedExpression != null) {
		final ASTNode parent = selectedExpression.getParent();
		if (selectedExpression instanceof NullLiteral) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_null_literals);
		} else if (selectedExpression instanceof ArrayInitializer) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_array_initializer);
		} else if (selectedExpression instanceof Assignment) {
			if (parent instanceof Expression && !(parent instanceof ParenthesizedExpression)) {
				return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_assignment);
			} else {
				return null;
			}
		} else if (selectedExpression instanceof SimpleName) {
			if ((((SimpleName) selectedExpression)).isDeclaration()) {
				return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_names_in_declarations);
			}
			if (parent instanceof QualifiedName && selectedExpression.getLocationInParent() == QualifiedName.NAME_PROPERTY || parent instanceof FieldAccess && selectedExpression.getLocationInParent() == FieldAccess.NAME_PROPERTY) {
				return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_select_expression);
			}
		} else if (selectedExpression instanceof VariableDeclarationExpression && parent instanceof TryStatement) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_resource_in_try_with_resources);
		}
	}

	return null;
}
 
Example 9
Source File: ReorgPolicyFactory.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected RefactoringStatus verifyDestination(IJavaElement javaElement) throws JavaModelException {
	RefactoringStatus superStatus= super.verifyDestination(javaElement);
	if (superStatus.hasFatalError()) {
		return superStatus;
	}
	IJavaProject javaProject= getDestinationJavaProject();
	if (isParentOfAny(javaProject, getPackageFragmentRoots())) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_element2parent);
	}
	return superStatus;
}
 
Example 10
Source File: ReorgPolicyFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public RefactoringStatus verifyDestination(IReorgDestination destination) throws JavaModelException {
	if (!(destination instanceof JavaElementDestination))
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_invalidDestinationKind);

	JavaElementDestination javaElementDestination= (JavaElementDestination) destination;
	return verifyDestination(javaElementDestination.getJavaElement(), javaElementDestination.getLocation());
}
 
Example 11
Source File: RenameFieldProcessor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
	IField primary= (IField) fField.getPrimaryElement();
	if (primary == null || !primary.exists()) {
		String message= Messages.format(RefactoringCoreMessages.RenameFieldRefactoring_deleted, BasicElementLabels.getFileName(fField.getCompilationUnit()));
		return RefactoringStatus.createFatalErrorStatus(message);
	}
	fField= primary;

	return Checks.checkIfCuBroken(fField);
}
 
Example 12
Source File: ReorgPolicyFactory.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected RefactoringStatus verifyDestination(IResource resource) {
	Assert.isNotNull(resource);
	if (!resource.exists() || resource.isPhantom()) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_phantom);
	}
	if (!resource.isAccessible()) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_inaccessible);
	}

	if (!(resource instanceof IContainer)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (resource.getType() == IResource.ROOT) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (isChildOfOrEqualToAnyFolder(resource)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_not_this_resource);
	}

	if (containsLinkedResources() && !ReorgUtils.canBeDestinationForLinkedResources(resource)) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_linked);
	}

	return new RefactoringStatus();
}
 
Example 13
Source File: RenameFieldProcessor.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
	IField primary= (IField) fField.getPrimaryElement();
	if (primary == null || !primary.exists()) {
		String message= Messages.format(RefactoringCoreMessages.RenameFieldRefactoring_deleted, BasicElementLabels.getFileName(fField.getCompilationUnit()));
		return RefactoringStatus.createFatalErrorStatus(message);
	}
	fField= primary;

	return Checks.checkIfCuBroken(fField);
}
 
Example 14
Source File: RenamePackageProcessor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private RefactoringStatus checkPackageInCurrentRoot(String newName) throws CoreException {
	if (fRenameSubpackages) {
		String currentName= getCurrentElementName();
		if (isAncestorPackage(currentName, newName)) {
			// renaming to subpackage (a -> a.b) is always OK, since all subpackages are also renamed
			return null;
		}
		if (! isAncestorPackage(newName, currentName)) {
			// renaming to an unrelated package
			if (! isPackageNameOkInRoot(newName, getPackageFragmentRoot())) {
				return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenamePackageRefactoring_package_exists);
			}
		}
		// renaming to superpackage (a.b -> a) or another package is OK iff
		// 'a.b' does not contain any subpackage that would collide with another subpackage of 'a'
		// (e.g. a.b.c collides if a.c already exists, but a.b.b does not collide with a.b)
		IPackageFragment[] packsToRename= JavaElementUtil.getPackageAndSubpackages(fPackage);
		for (int i = 0; i < packsToRename.length; i++) {
			IPackageFragment pack = packsToRename[i];
			String newPack= newName + pack.getElementName().substring(currentName.length());
			if (! isAncestorPackage(currentName, newPack) && ! isPackageNameOkInRoot(newPack, getPackageFragmentRoot())) {
				String msg= Messages.format(RefactoringCoreMessages.RenamePackageProcessor_subpackage_collides, BasicElementLabels.getJavaElementName(newPack));
				return RefactoringStatus.createFatalErrorStatus(msg);
			}
		}
		return null;

	} else if (! isPackageNameOkInRoot(newName, getPackageFragmentRoot())) {
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenamePackageRefactoring_package_exists);
	} else {
		return null;
	}
}
 
Example 15
Source File: ReorgPolicyFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public RefactoringStatus initialize(JavaRefactoringArguments arguments) {
	final RefactoringStatus status= new RefactoringStatus();
	int rootCount= 0;
	String value= arguments.getAttribute(ATTRIBUTE_ROOTS);
	if (value != null && !"".equals(value)) {//$NON-NLS-1$
		try {
			rootCount= Integer.parseInt(value);
		} catch (NumberFormatException exception) {
			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_ROOTS));
		}
	} else
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_ROOTS));
	String handle= null;
	List<IJavaElement> elements= new ArrayList<IJavaElement>();
	for (int index= 0; index < rootCount; index++) {
		final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1);
		handle= arguments.getAttribute(attribute);
		if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
			final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(arguments.getProject(), handle, false);
			if (element == null || !element.exists() || element.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
				status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, getProcessorId(), getRefactoringId()));
			else
				elements.add(element);
		} else
			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
	}
	fPackageFragmentRoots= elements.toArray(new IPackageFragmentRoot[elements.size()]);
	status.merge(super.initialize(arguments));
	return status;
}
 
Example 16
Source File: ReorgPolicyFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected RefactoringStatus verifyDestination(IResource resource) throws JavaModelException {
	return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_noCopying);
}
 
Example 17
Source File: ReorgPolicyFactory.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected RefactoringStatus verifyDestination(IJavaElement javaElement) throws JavaModelException {
	return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_noMoving);
}
 
Example 18
Source File: InlineTempRefactoring.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private RefactoringStatus checkInitializer(VariableDeclaration decl) {
	if (decl.getInitializer().getNodeType() == ASTNode.NULL_LITERAL)
		return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InlineTemRefactoring_error_message_nulLiteralsCannotBeInlined);
	return null;
}
 
Example 19
Source File: ExtractTempRefactoring.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
private RefactoringStatus checkSelection(IProgressMonitor pm) throws JavaModelException {
	try {
		pm.beginTask("", 8); //$NON-NLS-1$

		IExpressionFragment selectedExpression = getSelectedExpression();

		if (selectedExpression == null) {
			String message = RefactoringCoreMessages.ExtractTempRefactoring_select_expression;
			return CodeRefactoringUtil.checkMethodSyntaxErrors(fSelectionStart, fSelectionLength, fCompilationUnitNode, message);
		}
		pm.worked(1);

		if (isUsedInExplicitConstructorCall()) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_explicit_constructor);
		}
		pm.worked(1);

		ASTNode associatedNode = selectedExpression.getAssociatedNode();
		if (getEnclosingBodyNode() == null || ASTNodes.getParent(associatedNode, Annotation.class) != null) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_expr_in_method_or_initializer);
		}
		pm.worked(1);

		if (associatedNode instanceof Name && associatedNode.getParent() instanceof ClassInstanceCreation && associatedNode.getLocationInParent() == ClassInstanceCreation.TYPE_PROPERTY) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_name_in_new);
		}
		pm.worked(1);

		RefactoringStatus result = new RefactoringStatus();
		result.merge(checkExpression());
		if (result.hasFatalError()) {
			return result;
		}
		pm.worked(1);

		result.merge(checkExpressionFragmentIsRValue());
		if (result.hasFatalError()) {
			return result;
		}
		pm.worked(1);

		if (isUsedInForInitializerOrUpdater(getSelectedExpression().getAssociatedExpression())) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_for_initializer_updater);
		}
		pm.worked(1);

		if (isReferringToLocalVariableFromFor(getSelectedExpression().getAssociatedExpression())) {
			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_refers_to_for_variable);
		}
		pm.worked(1);

		return result;
	} finally {
		pm.done();
	}
}
 
Example 20
Source File: RenamePackageProcessor.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
private RefactoringStatus initialize(JavaRefactoringArguments extended) {
	final String handle= extended.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
	if (handle != null) {
		final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(extended.getProject(), handle, false);
		if (element == null || !element.exists() || element.getElementType() != IJavaElement.PACKAGE_FRAGMENT) {
			return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, getProcessorName(), IJavaRefactorings.RENAME_PACKAGE);
		} else {
			fPackage= (IPackageFragment) element;
		}
	} else {
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
	}
	final String name= extended.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
	if (name != null && !"".equals(name)) {
		setNewElementName(name);
	} else {
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
	}
	final String patterns= extended.getAttribute(ATTRIBUTE_PATTERNS);
	if (patterns != null && !"".equals(patterns)) {
		fFilePatterns= patterns;
	}
	else {
		fFilePatterns= ""; //$NON-NLS-1$
	}
	final String references= extended.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
	if (references != null) {
		fUpdateReferences= Boolean.valueOf(references).booleanValue();
	} else {
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
	}
	final String matches= extended.getAttribute(ATTRIBUTE_TEXTUAL_MATCHES);
	if (matches != null) {
		fUpdateTextualMatches= Boolean.valueOf(matches).booleanValue();
	} else {
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_TEXTUAL_MATCHES));
	}
	final String qualified= extended.getAttribute(ATTRIBUTE_QUALIFIED);
	if (qualified != null) {
		fUpdateQualifiedNames= Boolean.valueOf(qualified).booleanValue();
	} else {
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_QUALIFIED));
	}
	final String hierarchical= extended.getAttribute(ATTRIBUTE_HIERARCHICAL);
	if (hierarchical != null) {
		fRenameSubpackages= Boolean.valueOf(hierarchical).booleanValue();
	} else {
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_HIERARCHICAL));
	}
	return new RefactoringStatus();
}