1 /*******************************************************************************
2 * Copyright (c) 2005, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.corext.refactoring;
13 import java.util.ArrayList;
14 import java.util.List;
16 import java.util.StringTokenizer;
18 import org.eclipse.core.runtime.CoreException;
19 import org.eclipse.core.runtime.IAdaptable;
20 import org.eclipse.core.runtime.Path;
22 import org.eclipse.core.resources.IResource;
23 import org.eclipse.core.resources.ResourcesPlugin;
25 import org.eclipse.ltk.core.refactoring.Refactoring;
26 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
27 import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
28 import org.eclipse.ltk.core.refactoring.participants.ReorgExecutionLog;
30 import org.eclipse.jdt.core.ICompilationUnit;
31 import org.eclipse.jdt.core.IField;
32 import org.eclipse.jdt.core.IJavaElement;
33 import org.eclipse.jdt.core.IJavaProject;
34 import org.eclipse.jdt.core.ILocalVariable;
35 import org.eclipse.jdt.core.IMember;
36 import org.eclipse.jdt.core.IMethod;
37 import org.eclipse.jdt.core.IPackageFragment;
38 import org.eclipse.jdt.core.IPackageFragmentRoot;
39 import org.eclipse.jdt.core.ISourceRange;
40 import org.eclipse.jdt.core.IType;
41 import org.eclipse.jdt.core.JavaCore;
42 import org.eclipse.jdt.core.JavaModelException;
43 import org.eclipse.jdt.core.Signature;
44 import org.eclipse.jdt.core.dom.ASTParser;
45 import org.eclipse.jdt.core.dom.CompilationUnit;
46 import org.eclipse.jdt.core.refactoring.IJavaRefactorings;
47 import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor;
49 import org.eclipse.jdt.internal.corext.refactoring.code.ConvertAnonymousToNestedRefactoring;
50 import org.eclipse.jdt.internal.corext.refactoring.code.ExtractConstantRefactoring;
51 import org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring;
52 import org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring;
53 import org.eclipse.jdt.internal.corext.refactoring.code.InlineConstantRefactoring;
54 import org.eclipse.jdt.internal.corext.refactoring.code.InlineTempRefactoring;
55 import org.eclipse.jdt.internal.corext.refactoring.code.IntroduceFactoryRefactoring;
56 import org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring;
57 import org.eclipse.jdt.internal.corext.refactoring.code.IntroduceParameterRefactoring;
58 import org.eclipse.jdt.internal.corext.refactoring.code.PromoteTempToFieldRefactoring;
59 import org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring;
60 import org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor;
61 import org.eclipse.jdt.internal.corext.refactoring.rename.MethodChecks;
62 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor;
63 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameEnumConstProcessor;
64 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor;
65 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor;
66 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor;
67 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor;
68 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameNonVirtualMethodProcessor;
69 import org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor;
70 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameSourceFolderProcessor;
71 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeParameterProcessor;
72 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
73 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor;
74 import org.eclipse.jdt.internal.corext.refactoring.reorg.CreateTargetExecutionLog;
75 import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaCopyProcessor;
76 import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaDeleteProcessor;
77 import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor;
78 import org.eclipse.jdt.internal.corext.refactoring.reorg.LoggedCreateTargetQueries;
79 import org.eclipse.jdt.internal.corext.refactoring.reorg.LoggedNewNameQueries;
80 import org.eclipse.jdt.internal.corext.refactoring.reorg.MonitoringCreateTargetQueries;
81 import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory;
82 import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory.MoveFilesFoldersAndCusPolicy;
83 import org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring;
84 import org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureProcessor;
85 import org.eclipse.jdt.internal.corext.refactoring.structure.ChangeTypeRefactoring;
86 import org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor;
87 import org.eclipse.jdt.internal.corext.refactoring.structure.ExtractSupertypeProcessor;
88 import org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopRefactoring;
89 import org.eclipse.jdt.internal.corext.refactoring.structure.MoveStaticMembersProcessor;
90 import org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor;
91 import org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoringProcessor;
92 import org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoringProcessor.MemberActionInfo;
93 import org.eclipse.jdt.internal.corext.refactoring.structure.UseSuperTypeProcessor;
94 import org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor;
95 import org.eclipse.jdt.internal.corext.util.JdtFlags;
96 import org.eclipse.jdt.internal.corext.util.Messages;
98 import org.eclipse.jdt.internal.ui.JavaPlugin;
99 import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider;
100 import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
101 import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
104 * A wrapper around the Map received from {@link JavaRefactoringDescriptor} to access and convert
107 public final class JavaRefactoringArguments {
109 /** The attribute map (element type: <code><String, String></code>) */
110 private final Map<String, String> fAttributes;
112 /** The name of the project, or <code>null</code> for the workspace */
113 private String fProject;
116 * Creates a new java refactoring arguments from arguments
119 * the project, or <code>null</code> for the workspace
123 public JavaRefactoringArguments(String project, Map<String, String> arguments) {
125 fAttributes= arguments;
129 * Returns the attribute with the specified name.
132 * the name of the attribute
133 * @return the attribute value, or <code>null</code>
135 public String getAttribute(final String name) {
136 return fAttributes.get(name);
140 * Returns the name of the project.
142 * @return the name of the project, or <code>null</code> for the workspace
144 public String getProject() {
152 public String toString() {
153 return getClass().getName() + fAttributes.toString();
156 public RefactoringStatus generated_7356054422577277715(ExtractConstantRefactoring extractconstantrefactoring) {
157 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
158 if (selection != null) {
161 final StringTokenizer tokenizer= new StringTokenizer(selection);
162 if (tokenizer.hasMoreTokens())
163 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
164 if (tokenizer.hasMoreTokens())
165 length= Integer.valueOf(tokenizer.nextToken()).intValue();
166 if (offset >= 0 && length >= 0) {
167 extractconstantrefactoring.fSelectionStart= offset;
168 extractconstantrefactoring.fSelectionLength= length;
170 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
172 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
173 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
174 if (handle != null) {
175 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
176 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
177 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, extractconstantrefactoring.getName(), IJavaRefactorings.EXTRACT_CONSTANT);
179 extractconstantrefactoring.fCu= (ICompilationUnit) element;
181 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
182 final String visibility= getAttribute(ExtractConstantRefactoring.ATTRIBUTE_VISIBILITY);
183 if (visibility != null && !"".equals(visibility)) {//$NON-NLS-1$
186 flag= Integer.parseInt(visibility);
187 } catch (NumberFormatException exception) {
188 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractConstantRefactoring.ATTRIBUTE_VISIBILITY));
190 extractconstantrefactoring.fVisibility= JdtFlags.getVisibilityString(flag);
192 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
193 if (name != null && !"".equals(name)) //$NON-NLS-1$
194 extractconstantrefactoring.fConstantName= name;
196 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
197 final String replace= getAttribute(ExtractConstantRefactoring.ATTRIBUTE_REPLACE);
198 if (replace != null) {
199 extractconstantrefactoring.fReplaceAllOccurrences= Boolean.valueOf(replace).booleanValue();
201 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractConstantRefactoring.ATTRIBUTE_REPLACE));
202 final String declareFinal= getAttribute(ExtractConstantRefactoring.ATTRIBUTE_QUALIFY);
203 if (declareFinal != null) {
204 extractconstantrefactoring.fQualifyReferencesWithDeclaringClassName= Boolean.valueOf(declareFinal).booleanValue();
206 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractConstantRefactoring.ATTRIBUTE_QUALIFY));
207 return new RefactoringStatus();
210 public RefactoringStatus generated_8698951336202486639(ExtractTempRefactoring extracttemprefactoring) {
211 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
212 if (selection != null) {
215 final StringTokenizer tokenizer= new StringTokenizer(selection);
216 if (tokenizer.hasMoreTokens())
217 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
218 if (tokenizer.hasMoreTokens())
219 length= Integer.valueOf(tokenizer.nextToken()).intValue();
220 if (offset >= 0 && length >= 0) {
221 extracttemprefactoring.fSelectionStart= offset;
222 extracttemprefactoring.fSelectionLength= length;
224 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
226 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
227 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
228 if (handle != null) {
229 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
230 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
231 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, extracttemprefactoring.getName(), IJavaRefactorings.EXTRACT_LOCAL_VARIABLE);
233 extracttemprefactoring.fCu= (ICompilationUnit) element;
235 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
236 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
237 if (name != null && !"".equals(name)) //$NON-NLS-1$
238 extracttemprefactoring.fTempName= name;
240 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
241 final String replace= getAttribute(ExtractTempRefactoring.ATTRIBUTE_REPLACE);
242 if (replace != null) {
243 extracttemprefactoring.fReplaceAllOccurrences= Boolean.valueOf(replace).booleanValue();
245 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractTempRefactoring.ATTRIBUTE_REPLACE));
246 final String declareFinal= getAttribute(ExtractTempRefactoring.ATTRIBUTE_FINAL);
247 if (declareFinal != null) {
248 extracttemprefactoring.fDeclareFinal= Boolean.valueOf(declareFinal).booleanValue();
250 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractTempRefactoring.ATTRIBUTE_FINAL));
251 return new RefactoringStatus();
254 public RefactoringStatus generated_8748163025498223751(IntroduceParameterRefactoring introduceparameterrefactoring) {
255 introduceparameterrefactoring.fArguments= this;
256 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
257 if (selection != null) {
260 final StringTokenizer tokenizer= new StringTokenizer(selection);
261 if (tokenizer.hasMoreTokens())
262 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
263 if (tokenizer.hasMoreTokens())
264 length= Integer.valueOf(tokenizer.nextToken()).intValue();
265 if (offset >= 0 && length >= 0) {
266 introduceparameterrefactoring.fSelectionStart= offset;
267 introduceparameterrefactoring.fSelectionLength= length;
269 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
271 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
272 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
273 if (handle != null) {
274 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
275 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
276 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, introduceparameterrefactoring.getName(), IJavaRefactorings.INTRODUCE_PARAMETER);
278 introduceparameterrefactoring.fSourceCU= (ICompilationUnit)element;
280 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
281 final String name= getAttribute(IntroduceParameterRefactoring.ATTRIBUTE_ARGUMENT);
282 if (name != null && !"".equals(name)) //$NON-NLS-1$
283 introduceparameterrefactoring.fParameterName= name;
285 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, IntroduceParameterRefactoring.ATTRIBUTE_ARGUMENT));
286 return new RefactoringStatus();
289 public RefactoringStatus generated_241571537466594463(InlineConstantRefactoring inlineconstantrefactoring) {
290 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
291 if (selection != null) {
294 final StringTokenizer tokenizer= new StringTokenizer(selection);
295 if (tokenizer.hasMoreTokens())
296 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
297 if (tokenizer.hasMoreTokens())
298 length= Integer.valueOf(tokenizer.nextToken()).intValue();
299 if (offset >= 0 && length >= 0) {
300 inlineconstantrefactoring.fSelectionStart= offset;
301 inlineconstantrefactoring.fSelectionLength= length;
303 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
305 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
306 if (handle != null) {
307 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
308 if (element == null || !element.exists())
309 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, inlineconstantrefactoring.getName(), IJavaRefactorings.INLINE_CONSTANT);
311 if (element instanceof ICompilationUnit) {
312 inlineconstantrefactoring.fSelectionCu= (ICompilationUnit) element;
313 if (selection == null)
314 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
315 } else if (element instanceof IField) {
316 final IField field= (IField) element;
318 final ISourceRange range= field.getNameRange();
320 inlineconstantrefactoring.fSelectionStart= range.getOffset();
321 inlineconstantrefactoring.fSelectionLength= range.getLength();
323 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, IJavaRefactorings.INLINE_CONSTANT));
324 } catch (JavaModelException exception) {
325 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, inlineconstantrefactoring.getName(), IJavaRefactorings.INLINE_CONSTANT);
327 inlineconstantrefactoring.fSelectionCu= field.getCompilationUnit();
329 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { handle, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT}));
330 final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL);
331 parser.setResolveBindings(true);
332 parser.setSource(inlineconstantrefactoring.fSelectionCu);
333 final CompilationUnit unit= (CompilationUnit) parser.createAST(null);
334 inlineconstantrefactoring.initialize(inlineconstantrefactoring.fSelectionCu, unit);
335 if (inlineconstantrefactoring.checkStaticFinalConstantNameSelected().hasFatalError())
336 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, inlineconstantrefactoring.getName(), IJavaRefactorings.INLINE_CONSTANT);
339 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
340 final String replace= getAttribute(InlineConstantRefactoring.ATTRIBUTE_REPLACE);
341 if (replace != null) {
342 inlineconstantrefactoring.fReplaceAllReferences= Boolean.valueOf(replace).booleanValue();
344 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InlineConstantRefactoring.ATTRIBUTE_REPLACE));
345 final String remove= getAttribute(InlineConstantRefactoring.ATTRIBUTE_REMOVE);
347 inlineconstantrefactoring.fRemoveDeclaration= Boolean.valueOf(remove).booleanValue();
349 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InlineConstantRefactoring.ATTRIBUTE_REMOVE));
350 return new RefactoringStatus();
353 public RefactoringStatus generated_3243925448446711275(ExtractMethodRefactoring extractmethodrefactoring) {
354 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
355 if (selection == null)
356 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
360 final StringTokenizer tokenizer= new StringTokenizer(selection);
361 if (tokenizer.hasMoreTokens())
362 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
363 if (tokenizer.hasMoreTokens())
364 length= Integer.valueOf(tokenizer.nextToken()).intValue();
365 if (offset < 0 || length < 0)
366 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
368 extractmethodrefactoring.fSelectionStart= offset;
369 extractmethodrefactoring.fSelectionLength= length;
371 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
373 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
375 IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
376 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
377 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, extractmethodrefactoring.getName(), IJavaRefactorings.EXTRACT_METHOD);
379 extractmethodrefactoring.fCUnit= (ICompilationUnit) element;
380 final String visibility= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_VISIBILITY);
381 if (visibility != null && visibility.length() != 0) {
384 flag= Integer.parseInt(visibility);
385 } catch (NumberFormatException exception) {
386 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_VISIBILITY));
388 extractmethodrefactoring.fVisibility= flag;
390 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
391 if (name == null || name.length() == 0)
392 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
394 extractmethodrefactoring.fMethodName= name;
396 final String destination= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_DESTINATION);
397 if (destination != null && destination.length() == 0) {
400 index= Integer.parseInt(destination);
401 } catch (NumberFormatException exception) {
402 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_DESTINATION));
404 extractmethodrefactoring.fDestinationIndex= index;
406 final String replace= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_REPLACE);
408 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_REPLACE));
410 extractmethodrefactoring.fReplaceDuplicates= Boolean.valueOf(replace).booleanValue();
412 final String comments= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_COMMENTS);
413 if (comments == null)
414 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_COMMENTS));
416 extractmethodrefactoring.fGenerateJavadoc= Boolean.valueOf(comments).booleanValue();
418 final String exceptions= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_EXCEPTIONS);
419 if (exceptions == null)
420 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_EXCEPTIONS));
422 extractmethodrefactoring.fThrowRuntimeExceptions= Boolean.valueOf(exceptions).booleanValue();
424 return new RefactoringStatus();
427 public RefactoringStatus generated_2570321746173001286(IntroduceFactoryRefactoring introducefactoryrefactoring) {
428 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
429 if (selection != null) {
432 final StringTokenizer tokenizer= new StringTokenizer(selection);
433 if (tokenizer.hasMoreTokens())
434 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
435 if (tokenizer.hasMoreTokens())
436 length= Integer.valueOf(tokenizer.nextToken()).intValue();
437 if (offset >= 0 && length >= 0) {
438 introducefactoryrefactoring.fSelectionStart= offset;
439 introducefactoryrefactoring.fSelectionLength= length;
441 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
443 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
444 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
445 if (handle != null) {
446 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
447 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
448 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, introducefactoryrefactoring.getName(), IJavaRefactorings.INTRODUCE_FACTORY);
450 introducefactoryrefactoring.fCUHandle= (ICompilationUnit) element;
451 introducefactoryrefactoring.initialize();
454 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
455 handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + 1);
456 if (handle != null) {
457 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
458 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
459 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, introducefactoryrefactoring.getName(), IJavaRefactorings.INTRODUCE_FACTORY);
461 final IType type= (IType) element;
462 introducefactoryrefactoring.fFactoryClassName= type.getFullyQualifiedName();
465 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
466 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
467 if (name != null && !"".equals(name)) //$NON-NLS-1$
468 introducefactoryrefactoring.fNewMethodName= name;
470 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
471 final String protect= getAttribute(IntroduceFactoryRefactoring.ATTRIBUTE_PROTECT);
472 if (protect != null) {
473 introducefactoryrefactoring.fProtectConstructor= Boolean.valueOf(protect).booleanValue();
475 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, IntroduceFactoryRefactoring.ATTRIBUTE_PROTECT));
476 return new RefactoringStatus();
479 public RefactoringStatus generated_433400260767030263(InlineTempRefactoring inlinetemprefactoring) {
480 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
481 if (selection != null) {
484 final StringTokenizer tokenizer= new StringTokenizer(selection);
485 if (tokenizer.hasMoreTokens())
486 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
487 if (tokenizer.hasMoreTokens())
488 length= Integer.valueOf(tokenizer.nextToken()).intValue();
489 if (offset >= 0 && length >= 0) {
490 inlinetemprefactoring.fSelectionStart= offset;
491 inlinetemprefactoring.fSelectionLength= length;
493 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
495 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
496 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
497 if (handle != null) {
498 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
499 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
500 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, inlinetemprefactoring.getName(), IJavaRefactorings.INLINE_LOCAL_VARIABLE);
502 inlinetemprefactoring.fCu= (ICompilationUnit) element;
503 if (inlinetemprefactoring.checkIfTempSelected().hasFatalError())
504 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, inlinetemprefactoring.getName(), IJavaRefactorings.INLINE_LOCAL_VARIABLE);
507 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
508 return new RefactoringStatus();
511 public RefactoringStatus generated_4920606050913630989(IntroduceIndirectionRefactoring introduceindirectionrefactoring) {
512 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
513 if (handle != null) {
514 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
515 if (element == null || !element.exists() || element.getElementType() != IJavaElement.METHOD)
516 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, introduceindirectionrefactoring.getName(), IJavaRefactorings.INTRODUCE_INDIRECTION);
518 introduceindirectionrefactoring.fTargetMethod= (IMethod) element;
520 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
521 handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + 1);
522 if (handle != null) {
523 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
524 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
525 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, introduceindirectionrefactoring.getName(), IJavaRefactorings.INTRODUCE_INDIRECTION);
527 introduceindirectionrefactoring.fIntermediaryClass= (IType) element;
529 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + 1));
530 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
531 if (references != null) {
532 introduceindirectionrefactoring.fUpdateReferences= Boolean.valueOf(references).booleanValue();
534 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
535 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
536 if (name != null && !"".equals(name)) //$NON-NLS-1$
537 return introduceindirectionrefactoring.setIntermediaryMethodName(name);
539 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
542 public RefactoringStatus generated_3022039671009748593(ConvertAnonymousToNestedRefactoring convertanonymoustonestedrefactoring) {
543 convertanonymoustonestedrefactoring.fSelfInitializing= true;
544 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
545 if (handle != null) {
546 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
547 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
548 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, convertanonymoustonestedrefactoring.getName(), IJavaRefactorings.CONVERT_ANONYMOUS);
550 convertanonymoustonestedrefactoring.fCu= (ICompilationUnit) element;
553 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
554 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
555 if (name != null && !"".equals(name)) //$NON-NLS-1$
556 convertanonymoustonestedrefactoring.fClassName= name;
558 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
559 final String visibility= getAttribute(ConvertAnonymousToNestedRefactoring.ATTRIBUTE_VISIBILITY);
560 if (visibility != null && !"".equals(visibility)) {//$NON-NLS-1$
563 flag= Integer.parseInt(visibility);
564 } catch (NumberFormatException exception) {
565 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ConvertAnonymousToNestedRefactoring.ATTRIBUTE_VISIBILITY));
567 convertanonymoustonestedrefactoring.fVisibility= flag;
569 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
570 if (selection != null) {
573 final StringTokenizer tokenizer= new StringTokenizer(selection);
574 if (tokenizer.hasMoreTokens())
575 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
576 if (tokenizer.hasMoreTokens())
577 length= Integer.valueOf(tokenizer.nextToken()).intValue();
578 if (offset >= 0 && length >= 0) {
579 convertanonymoustonestedrefactoring.fSelectionStart= offset;
580 convertanonymoustonestedrefactoring.fSelectionLength= length;
582 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
584 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
585 final String declareStatic= getAttribute(ConvertAnonymousToNestedRefactoring.ATTRIBUTE_STATIC);
586 if (declareStatic != null) {
587 convertanonymoustonestedrefactoring.fDeclareStatic= Boolean.valueOf(declareStatic).booleanValue();
589 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ConvertAnonymousToNestedRefactoring.ATTRIBUTE_STATIC));
590 final String declareFinal= getAttribute(ConvertAnonymousToNestedRefactoring.ATTRIBUTE_FINAL);
591 if (declareFinal != null) {
592 convertanonymoustonestedrefactoring.fDeclareFinal= Boolean.valueOf(declareStatic).booleanValue();
594 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ConvertAnonymousToNestedRefactoring.ATTRIBUTE_FINAL));
595 return new RefactoringStatus();
598 public RefactoringStatus generated_2404816089335359482(PromoteTempToFieldRefactoring promotetemptofieldrefactoring) {
599 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
600 if (selection != null) {
603 final StringTokenizer tokenizer= new StringTokenizer(selection);
604 if (tokenizer.hasMoreTokens())
605 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
606 if (tokenizer.hasMoreTokens())
607 length= Integer.valueOf(tokenizer.nextToken()).intValue();
608 if (offset >= 0 && length >= 0) {
609 promotetemptofieldrefactoring.fSelectionStart= offset;
610 promotetemptofieldrefactoring.fSelectionLength= length;
612 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
614 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
615 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
616 if (handle != null) {
617 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
618 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
619 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, promotetemptofieldrefactoring.getName(), IJavaRefactorings.CONVERT_LOCAL_VARIABLE);
621 promotetemptofieldrefactoring.fCu= (ICompilationUnit) element;
623 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
624 final String visibility= getAttribute(PromoteTempToFieldRefactoring.ATTRIBUTE_VISIBILITY);
625 if (visibility != null && !"".equals(visibility)) {//$NON-NLS-1$
628 flag= Integer.parseInt(visibility);
629 } catch (NumberFormatException exception) {
630 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_VISIBILITY));
632 promotetemptofieldrefactoring.fVisibility= flag;
634 final String initialize= getAttribute(PromoteTempToFieldRefactoring.ATTRIBUTE_INITIALIZE);
635 if (initialize != null && !"".equals(initialize)) {//$NON-NLS-1$
638 value= Integer.parseInt(initialize);
639 } catch (NumberFormatException exception) {
640 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_INITIALIZE));
642 promotetemptofieldrefactoring.fInitializeIn= value;
644 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
645 if (name != null && !"".equals(name)) //$NON-NLS-1$
646 promotetemptofieldrefactoring.fFieldName= name;
648 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
649 final String declareStatic= getAttribute(PromoteTempToFieldRefactoring.ATTRIBUTE_STATIC);
650 if (declareStatic != null) {
651 promotetemptofieldrefactoring.fDeclareStatic= Boolean.valueOf(declareStatic).booleanValue();
653 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_STATIC));
654 final String declareFinal= getAttribute(PromoteTempToFieldRefactoring.ATTRIBUTE_FINAL);
655 if (declareFinal != null) {
656 promotetemptofieldrefactoring.fDeclareFinal= Boolean.valueOf(declareFinal).booleanValue();
658 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_FINAL));
659 return new RefactoringStatus();
662 public RefactoringStatus generated_8680542984146802295(InferTypeArgumentsRefactoring infertypeargumentsrefactoring) {
663 final String clone= getAttribute(InferTypeArgumentsRefactoring.ATTRIBUTE_CLONE);
665 infertypeargumentsrefactoring.fAssumeCloneReturnsSameType= Boolean.valueOf(clone).booleanValue();
667 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InferTypeArgumentsRefactoring.ATTRIBUTE_CLONE));
668 final String leave= getAttribute(InferTypeArgumentsRefactoring.ATTRIBUTE_LEAVE);
670 infertypeargumentsrefactoring.fLeaveUnconstrainedRaw= Boolean.valueOf(leave).booleanValue();
672 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InferTypeArgumentsRefactoring.ATTRIBUTE_LEAVE));
674 final List<IJavaElement> elements= new ArrayList<IJavaElement>();
676 String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
677 final RefactoringStatus status= new RefactoringStatus();
678 while ((handle= getAttribute(attribute)) != null) {
679 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
680 if (element == null || !element.exists())
681 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, infertypeargumentsrefactoring.getName(), IJavaRefactorings.INFER_TYPE_ARGUMENTS);
683 elements.add(element);
685 attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
687 infertypeargumentsrefactoring.fElements= elements.toArray(new IJavaElement[elements.size()]);
688 if (elements.isEmpty())
689 return JavaRefactoringDescriptorUtil.createInputFatalStatus(null, infertypeargumentsrefactoring.getName(), IJavaRefactorings.INFER_TYPE_ARGUMENTS);
692 return new RefactoringStatus();
695 public RefactoringStatus generated_1384567091643529(RenameLocalVariableProcessor renamelocalvariableprocessor) {
696 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
697 if (handle != null) {
698 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
699 if (element != null && element.exists()) {
700 if (element.getElementType() == IJavaElement.COMPILATION_UNIT) {
701 renamelocalvariableprocessor.fCu= (ICompilationUnit) element;
702 } else if (element.getElementType() == IJavaElement.LOCAL_VARIABLE) {
703 renamelocalvariableprocessor.fLocalVariable= (ILocalVariable) element;
704 renamelocalvariableprocessor.fCu= (ICompilationUnit) renamelocalvariableprocessor.fLocalVariable.getAncestor(IJavaElement.COMPILATION_UNIT);
705 if (renamelocalvariableprocessor.fCu == null)
706 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
708 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
710 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
712 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
713 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
714 if (name != null && !"".equals(name)) //$NON-NLS-1$
715 renamelocalvariableprocessor.setNewElementName(name);
717 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
718 if (renamelocalvariableprocessor.fCu != null && renamelocalvariableprocessor.fLocalVariable == null) {
719 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
720 if (selection != null) {
723 final StringTokenizer tokenizer= new StringTokenizer(selection);
724 if (tokenizer.hasMoreTokens())
725 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
726 if (tokenizer.hasMoreTokens())
727 length= Integer.valueOf(tokenizer.nextToken()).intValue();
728 if (offset >= 0 && length >= 0) {
730 final IJavaElement[] elements= renamelocalvariableprocessor.fCu.codeSelect(offset, length);
731 if (elements != null) {
732 for (int index= 0; index < elements.length; index++) {
733 final IJavaElement element= elements[index];
734 if (element instanceof ILocalVariable)
735 renamelocalvariableprocessor.fLocalVariable= (ILocalVariable) element;
738 if (renamelocalvariableprocessor.fLocalVariable == null)
739 return JavaRefactoringDescriptorUtil.createInputFatalStatus(null, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
740 } catch (JavaModelException exception) {
741 JavaPlugin.log(exception);
744 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection,
745 JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION }));
747 return RefactoringStatus
748 .createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
750 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
751 if (references != null) {
752 renamelocalvariableprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
754 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
755 return new RefactoringStatus();
758 public RefactoringStatus generated_8322000951051367342(RenameTypeParameterProcessor renametypeparameterprocessor) {
759 String parameter= getAttribute(RenameTypeParameterProcessor.ATTRIBUTE_PARAMETER);
760 if (parameter == null || "".equals(parameter)) //$NON-NLS-1$
761 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameTypeParameterProcessor.ATTRIBUTE_PARAMETER));
762 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
763 if (handle != null) {
764 IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
765 if (element == null || !element.exists())
766 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renametypeparameterprocessor.getProcessorName(), IJavaRefactorings.RENAME_TYPE_PARAMETER);
768 if (element instanceof IMethod)
769 renametypeparameterprocessor.fTypeParameter= ((IMethod) element).getTypeParameter(parameter);
770 else if (element instanceof IType)
771 renametypeparameterprocessor.fTypeParameter= ((IType) element).getTypeParameter(parameter);
773 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { handle,
774 JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT }));
775 if (renametypeparameterprocessor.fTypeParameter == null || !renametypeparameterprocessor.fTypeParameter.exists())
776 return JavaRefactoringDescriptorUtil.createInputFatalStatus(renametypeparameterprocessor.fTypeParameter, renametypeparameterprocessor.getProcessorName(), IJavaRefactorings.RENAME_TYPE_PARAMETER);
779 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
780 String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
781 if (name != null && !"".equals(name)) //$NON-NLS-1$
782 renametypeparameterprocessor.setNewElementName(name);
784 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
785 String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
786 if (references != null) {
787 renametypeparameterprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
789 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
790 return new RefactoringStatus();
793 public RefactoringStatus generated_7709597288538957024(RenameTypeProcessor renametypeprocessor) {
794 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
795 if (handle != null) {
796 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
797 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
798 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renametypeprocessor.getProcessorName(), IJavaRefactorings.RENAME_TYPE);
800 renametypeprocessor.fType= (IType) element;
802 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
803 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
804 if (name != null && !"".equals(name)) //$NON-NLS-1$
805 renametypeprocessor.setNewElementName(name);
807 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
808 final String patterns= getAttribute(RenameTypeProcessor.ATTRIBUTE_PATTERNS);
809 if (patterns != null && !"".equals(patterns)) //$NON-NLS-1$
810 renametypeprocessor.fFilePatterns= patterns;
811 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
812 if (references != null) {
813 renametypeprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
815 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
816 final String matches= getAttribute(RenameTypeProcessor.ATTRIBUTE_TEXTUAL_MATCHES);
817 if (matches != null) {
818 renametypeprocessor.fUpdateTextualMatches= Boolean.valueOf(matches).booleanValue();
820 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameTypeProcessor.ATTRIBUTE_TEXTUAL_MATCHES));
821 final String qualified= getAttribute(RenameTypeProcessor.ATTRIBUTE_QUALIFIED);
822 if (qualified != null) {
823 renametypeprocessor.fUpdateQualifiedNames= Boolean.valueOf(qualified).booleanValue();
825 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameTypeProcessor.ATTRIBUTE_QUALIFIED));
826 final String similarDeclarations= getAttribute(RenameTypeProcessor.ATTRIBUTE_SIMILAR_DECLARATIONS);
827 if (similarDeclarations != null)
828 renametypeprocessor.fUpdateSimilarElements= Boolean.valueOf(similarDeclarations).booleanValue();
830 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameTypeProcessor.ATTRIBUTE_SIMILAR_DECLARATIONS));
831 final String similarDeclarationsMatchingStrategy= getAttribute(RenameTypeProcessor.ATTRIBUTE_MATCHING_STRATEGY);
832 if (similarDeclarationsMatchingStrategy != null) {
834 renametypeprocessor.fRenamingStrategy= Integer.valueOf(similarDeclarationsMatchingStrategy).intValue();
835 } catch (NumberFormatException e) {
836 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new String[] { similarDeclarationsMatchingStrategy,
837 RenameTypeProcessor.ATTRIBUTE_QUALIFIED }));
840 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameTypeProcessor.ATTRIBUTE_MATCHING_STRATEGY));
841 return new RefactoringStatus();
844 public RefactoringStatus generated_7625949927267349606(RenameMethodProcessor renamemethodprocessor) {
845 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
846 if (name != null && !"".equals(name)) //$NON-NLS-1$
847 renamemethodprocessor.setNewElementName(name);
849 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
850 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
851 if (references != null) {
852 renamemethodprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
854 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
855 final String delegate= getAttribute(RenameMethodProcessor.ATTRIBUTE_DELEGATE);
856 if (delegate != null) {
857 renamemethodprocessor.fDelegateUpdating= Boolean.valueOf(delegate).booleanValue();
859 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameMethodProcessor.ATTRIBUTE_DELEGATE));
860 final String deprecate= getAttribute(RenameMethodProcessor.ATTRIBUTE_DEPRECATE);
861 if (deprecate != null) {
862 renamemethodprocessor.fDelegateDeprecation= Boolean.valueOf(deprecate).booleanValue();
864 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameMethodProcessor.ATTRIBUTE_DEPRECATE));
865 return new RefactoringStatus();
868 public RefactoringStatus generated_2421425486619230708(RenameFieldProcessor renamefieldprocessor) {
869 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
870 if (handle != null) {
871 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
872 if (element == null || !element.exists() || element.getElementType() != IJavaElement.FIELD)
873 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamefieldprocessor.getProcessorName(), IJavaRefactorings.RENAME_FIELD);
875 renamefieldprocessor.fField= (IField) element;
877 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
878 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
879 if (name != null && !"".equals(name)) //$NON-NLS-1$
880 renamefieldprocessor.setNewElementName(name);
882 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
883 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
884 if (references != null) {
885 renamefieldprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
887 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
888 final String matches= getAttribute(RenameFieldProcessor.ATTRIBUTE_TEXTUAL_MATCHES);
889 if (matches != null) {
890 renamefieldprocessor.fUpdateTextualMatches= Boolean.valueOf(matches).booleanValue();
892 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameFieldProcessor.ATTRIBUTE_TEXTUAL_MATCHES));
893 final String getters= getAttribute(RenameFieldProcessor.ATTRIBUTE_RENAME_GETTER);
895 renamefieldprocessor.fRenameGetter= Boolean.valueOf(getters).booleanValue();
897 renamefieldprocessor.fRenameGetter= false;
898 final String setters= getAttribute(RenameFieldProcessor.ATTRIBUTE_RENAME_SETTER);
900 renamefieldprocessor.fRenameSetter= Boolean.valueOf(setters).booleanValue();
902 renamefieldprocessor.fRenameSetter= false;
903 final String delegate= getAttribute(RenameFieldProcessor.ATTRIBUTE_DELEGATE);
904 if (delegate != null) {
905 renamefieldprocessor.fDelegateUpdating= Boolean.valueOf(delegate).booleanValue();
907 renamefieldprocessor.fDelegateUpdating= false;
908 final String deprecate= getAttribute(RenameFieldProcessor.ATTRIBUTE_DEPRECATE);
909 if (deprecate != null) {
910 renamefieldprocessor.fDelegateDeprecation= Boolean.valueOf(deprecate).booleanValue();
912 renamefieldprocessor.fDelegateDeprecation= false;
913 return new RefactoringStatus();
916 public RefactoringStatus generated_2531187143401763655(RenameCompilationUnitProcessor renamecompilationunitprocessor) {
917 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
918 if (handle == null) {
919 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
922 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
923 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
924 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamecompilationunitprocessor.getProcessorName(), IJavaRefactorings.RENAME_COMPILATION_UNIT);
926 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
927 if (name == null || name.length() == 0)
928 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
930 renamecompilationunitprocessor.fCu= (ICompilationUnit) element;
932 renamecompilationunitprocessor.computeRenameTypeRefactoring();
933 renamecompilationunitprocessor.setNewElementName(name);
934 } catch (CoreException exception) {
935 JavaPlugin.log(exception);
936 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamecompilationunitprocessor.getProcessorName(), IJavaRefactorings.RENAME_COMPILATION_UNIT);
938 return new RefactoringStatus();
941 public RefactoringStatus generated_7142081190444003944(RenameEnumConstProcessor renameenumconstprocessor) {
942 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
943 if (handle != null) {
944 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
945 if (element == null || !element.exists() || element.getElementType() != IJavaElement.FIELD)
946 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renameenumconstprocessor.getProcessorName(), IJavaRefactorings.RENAME_ENUM_CONSTANT);
948 renameenumconstprocessor.fField= (IField) element;
950 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
951 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
952 if (name != null && !"".equals(name)) //$NON-NLS-1$
953 renameenumconstprocessor.setNewElementName(name);
955 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
956 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
957 if (references != null) {
958 renameenumconstprocessor.setUpdateReferences(Boolean.valueOf(references).booleanValue());
960 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
961 final String matches= getAttribute(RenameFieldProcessor.ATTRIBUTE_TEXTUAL_MATCHES);
962 if (matches != null) {
963 renameenumconstprocessor.setUpdateTextualMatches(Boolean.valueOf(matches).booleanValue());
965 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameFieldProcessor.ATTRIBUTE_TEXTUAL_MATCHES));
966 return new RefactoringStatus();
969 public RefactoringStatus generated_3823543800967389868(RenamePackageProcessor renamepackageprocessor) {
970 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
971 if (handle != null) {
972 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
973 if (element == null || !element.exists() || element.getElementType() != IJavaElement.PACKAGE_FRAGMENT)
974 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamepackageprocessor.getProcessorName(), IJavaRefactorings.RENAME_PACKAGE);
976 renamepackageprocessor.fPackage= (IPackageFragment) element;
978 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
979 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
980 if (name != null && !"".equals(name)) //$NON-NLS-1$
981 renamepackageprocessor.setNewElementName(name);
983 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
984 final String patterns= getAttribute(RenamePackageProcessor.ATTRIBUTE_PATTERNS);
985 if (patterns != null && !"".equals(patterns)) //$NON-NLS-1$
986 renamepackageprocessor.fFilePatterns= patterns;
988 renamepackageprocessor.fFilePatterns= ""; //$NON-NLS-1$
989 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
990 if (references != null) {
991 renamepackageprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
993 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
994 final String matches= getAttribute(RenamePackageProcessor.ATTRIBUTE_TEXTUAL_MATCHES);
995 if (matches != null) {
996 renamepackageprocessor.fUpdateTextualMatches= Boolean.valueOf(matches).booleanValue();
998 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenamePackageProcessor.ATTRIBUTE_TEXTUAL_MATCHES));
999 final String qualified= getAttribute(RenamePackageProcessor.ATTRIBUTE_QUALIFIED);
1000 if (qualified != null) {
1001 renamepackageprocessor.fUpdateQualifiedNames= Boolean.valueOf(qualified).booleanValue();
1003 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenamePackageProcessor.ATTRIBUTE_QUALIFIED));
1004 final String hierarchical= getAttribute(RenamePackageProcessor.ATTRIBUTE_HIERARCHICAL);
1005 if (hierarchical != null) {
1006 renamepackageprocessor.fRenameSubpackages= Boolean.valueOf(hierarchical).booleanValue();
1008 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenamePackageProcessor.ATTRIBUTE_HIERARCHICAL));
1009 return new RefactoringStatus();
1012 public RefactoringStatus generated_6334781713094228201(RenameJavaProjectProcessor renamejavaprojectprocessor) {
1013 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1014 if (handle != null) {
1015 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1016 if (element == null || !element.exists() || element.getElementType() != IJavaElement.JAVA_PROJECT)
1017 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamejavaprojectprocessor.getProcessorName(), IJavaRefactorings.RENAME_JAVA_PROJECT);
1019 renamejavaprojectprocessor.fProject= (IJavaProject) element;
1021 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1022 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
1023 if (name != null && !"".equals(name)) //$NON-NLS-1$
1024 renamejavaprojectprocessor.setNewElementName(name);
1026 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
1027 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
1028 if (references != null) {
1029 renamejavaprojectprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
1031 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
1032 return new RefactoringStatus();
1035 public RefactoringStatus generated_4798413625482765856(RenameSourceFolderProcessor renamesourcefolderprocessor) {
1036 final String path= getAttribute(RenameSourceFolderProcessor.ATTRIBUTE_PATH);
1038 final IResource resource= ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
1039 if (resource == null || !resource.exists())
1040 return JavaRefactoringDescriptorUtil.createInputFatalStatus(resource, renamesourcefolderprocessor.getProcessorName(), IJavaRefactorings.RENAME_SOURCE_FOLDER);
1042 renamesourcefolderprocessor.fSourceFolder= (IPackageFragmentRoot) JavaCore.create(resource);
1044 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameSourceFolderProcessor.ATTRIBUTE_PATH));
1045 final String name= getAttribute(RenameSourceFolderProcessor.ATTRIBUTE_NAME);
1046 if (name != null && !"".equals(name)) //$NON-NLS-1$
1047 renamesourcefolderprocessor.setNewElementName(name);
1049 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameSourceFolderProcessor.ATTRIBUTE_NAME));
1050 return new RefactoringStatus();
1053 public RefactoringStatus generated_3953908905983949298(JavaCopyProcessor javacopyprocessor) {
1054 final RefactoringStatus status= new RefactoringStatus();
1055 javacopyprocessor.fCopyPolicy= ReorgPolicyFactory.createCopyPolicy(status, this);
1056 if (javacopyprocessor.fCopyPolicy != null && !status.hasFatalError()) {
1057 status.merge(javacopyprocessor.fCopyPolicy.initialize(this));
1058 if (!status.hasFatalError()) {
1059 final ReorgExecutionLog log= ReorgPolicyFactory.loadReorgExecutionLog(this);
1060 if (log != null && !status.hasFatalError())
1061 javacopyprocessor.setNewNameQueries(new LoggedNewNameQueries(log));
1067 public String generated_2588291806109480388(MoveFilesFoldersAndCusPolicy movefilesfoldersandcuspolicy) {
1068 final String patterns= getAttribute(ReorgPolicyFactory.ATTRIBUTE_PATTERNS);
1069 if (patterns != null && !"".equals(patterns)) //$NON-NLS-1$
1070 movefilesfoldersandcuspolicy.fFilePatterns= patterns;
1072 movefilesfoldersandcuspolicy.fFilePatterns= ""; //$NON-NLS-1$
1073 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
1077 public void generated_3618032577734140300(JavaMoveProcessor javamoveprocessor, final RefactoringStatus status) {
1078 javamoveprocessor.fMovePolicy= ReorgPolicyFactory.createMovePolicy(status, this);
1079 if (javamoveprocessor.fMovePolicy != null && !status.hasFatalError()) {
1080 final CreateTargetExecutionLog log= ReorgPolicyFactory.loadCreateTargetExecutionLog(this);
1081 if (log != null && !status.hasFatalError()) {
1082 javamoveprocessor.fMovePolicy.setDestinationCheck(false);
1083 javamoveprocessor.fCreateTargetQueries= new MonitoringCreateTargetQueries(new LoggedCreateTargetQueries(log), log);
1085 status.merge(javamoveprocessor.fMovePolicy.initialize(this));
1089 public RefactoringStatus generated_2657583268019953505(JavaDeleteProcessor javadeleteprocessor) {
1090 final RefactoringStatus status= new RefactoringStatus();
1091 final String subPackages= getAttribute(JavaDeleteProcessor.ATTRIBUTE_DELETE_SUBPACKAGES);
1092 if (subPackages != null) {
1093 javadeleteprocessor.fDeleteSubPackages= Boolean.valueOf(subPackages).booleanValue();
1095 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_DELETE_SUBPACKAGES));
1096 final String suggest= getAttribute(JavaDeleteProcessor.ATTRIBUTE_SUGGEST_ACCESSORS);
1097 if (suggest != null) {
1098 javadeleteprocessor.fSuggestGetterSetterDeletion= Boolean.valueOf(suggest).booleanValue();
1100 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_SUGGEST_ACCESSORS));
1101 int resourceCount= 0;
1102 int elementCount= 0;
1103 String value= getAttribute(JavaDeleteProcessor.ATTRIBUTE_RESOURCES);
1104 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1106 resourceCount= Integer.parseInt(value);
1107 } catch (NumberFormatException exception) {
1108 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_RESOURCES));
1111 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_RESOURCES));
1112 value= getAttribute(JavaDeleteProcessor.ATTRIBUTE_ELEMENTS);
1113 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1115 elementCount= Integer.parseInt(value);
1116 } catch (NumberFormatException exception) {
1117 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_ELEMENTS));
1120 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_ELEMENTS));
1121 String handle= null;
1122 List<IAdaptable> elements= new ArrayList<IAdaptable>();
1123 for (int index= 0; index < resourceCount; index++) {
1124 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1);
1125 handle= getAttribute(attribute);
1126 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1127 final IResource resource= JavaRefactoringDescriptorUtil.handleToResource(getProject(), handle);
1128 if (resource == null || !resource.exists())
1129 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(resource, javadeleteprocessor.getProcessorName(), IJavaRefactorings.DELETE));
1131 elements.add(resource);
1133 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1135 javadeleteprocessor.fResources= elements.toArray(new IResource[elements.size()]);
1136 elements= new ArrayList<IAdaptable>();
1137 for (int index= 0; index < elementCount; index++) {
1138 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (resourceCount + index + 1);
1139 handle= getAttribute(attribute);
1140 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1141 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1142 if (element == null || !element.exists())
1143 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, javadeleteprocessor.getProcessorName(), IJavaRefactorings.DELETE));
1145 elements.add(element);
1147 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1149 javadeleteprocessor.fJavaElements= elements.toArray(new IJavaElement[elements.size()]);
1150 javadeleteprocessor.fElements= new Object[javadeleteprocessor.fResources.length + javadeleteprocessor.fJavaElements.length];
1151 System.arraycopy(javadeleteprocessor.fResources, 0, javadeleteprocessor.fElements, 0, javadeleteprocessor.fResources.length);
1152 System.arraycopy(javadeleteprocessor.fJavaElements, 0, javadeleteprocessor.fElements, javadeleteprocessor.fResources.length, javadeleteprocessor.fJavaElements.length);
1156 public Refactoring generated_7431076020901813863(RefactoringStatus status) throws JavaModelException {
1157 String input= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1158 IMethod method= (IMethod) JavaRefactoringDescriptorUtil.handleToElement(getProject(), input);
1159 if (method == null) {
1160 status.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoringContribution_could_not_create, new Object[] { BasicElementLabels.getResourceName(getProject()), input }));
1164 JavaRenameProcessor processor;
1165 if (MethodChecks.isVirtual(method)) {
1166 processor= new RenameVirtualMethodProcessor(method, this, status);
1168 processor= new RenameNonVirtualMethodProcessor(method, this, status);
1170 return new RenameRefactoring(processor);
1173 public RefactoringStatus generated_6580071410129555571(SelfEncapsulateFieldRefactoring selfencapsulatefieldrefactoring) {
1174 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1175 if (handle != null) {
1176 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1177 if (element == null || !element.exists() || element.getElementType() != IJavaElement.FIELD)
1178 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, selfencapsulatefieldrefactoring.getName(), IJavaRefactorings.ENCAPSULATE_FIELD);
1180 selfencapsulatefieldrefactoring.fField= (IField) element;
1182 selfencapsulatefieldrefactoring.initialize(selfencapsulatefieldrefactoring.fField);
1183 } catch (JavaModelException exception) {
1184 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, selfencapsulatefieldrefactoring.getName(), IJavaRefactorings.ENCAPSULATE_FIELD);
1188 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1189 String name= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_GETTER);
1190 if (name != null && !"".equals(name)) //$NON-NLS-1$
1191 selfencapsulatefieldrefactoring.fGetterName= name;
1193 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_GETTER));
1194 name= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_SETTER);
1195 if (name != null && !"".equals(name)) //$NON-NLS-1$
1196 selfencapsulatefieldrefactoring.fSetterName= name;
1198 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_SETTER));
1199 final String encapsulate= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_DECLARING);
1200 if (encapsulate != null) {
1201 selfencapsulatefieldrefactoring.fEncapsulateDeclaringClass= Boolean.valueOf(encapsulate).booleanValue();
1203 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_DECLARING));
1204 final String matches= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_COMMENTS);
1205 if (matches != null) {
1206 selfencapsulatefieldrefactoring.fGenerateJavadoc= Boolean.valueOf(matches).booleanValue();
1208 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_COMMENTS));
1209 final String visibility= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_VISIBILITY);
1210 if (visibility != null && !"".equals(visibility)) {//$NON-NLS-1$
1213 flag= Integer.parseInt(visibility);
1214 } catch (NumberFormatException exception) {
1215 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_VISIBILITY));
1217 selfencapsulatefieldrefactoring.fVisibility= flag;
1219 final String insertion= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_INSERTION);
1220 if (insertion != null && !"".equals(insertion)) {//$NON-NLS-1$
1223 index= Integer.parseInt(insertion);
1224 } catch (NumberFormatException exception) {
1225 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_INSERTION));
1227 selfencapsulatefieldrefactoring.fInsertionIndex= index;
1229 return new RefactoringStatus();
1232 public RefactoringStatus generated_3485196732298811749(PushDownRefactoringProcessor pushdownrefactoringprocessor) {
1233 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1234 if (handle != null) {
1235 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1236 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1237 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, pushdownrefactoringprocessor.getProcessorName(), IJavaRefactorings.PUSH_DOWN);
1239 pushdownrefactoringprocessor.fCachedDeclaringType= (IType) element;
1242 final List<IJavaElement> elements= new ArrayList<IJavaElement>();
1243 final List<MemberActionInfo> infos= new ArrayList<MemberActionInfo>();
1244 String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1245 final RefactoringStatus status= new RefactoringStatus();
1246 while ((handle= getAttribute(attribute)) != null) {
1247 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1248 if (element == null || !element.exists())
1249 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, pushdownrefactoringprocessor.getProcessorName(), IJavaRefactorings.PUSH_DOWN));
1251 elements.add(element);
1252 if (getAttribute(PushDownRefactoringProcessor.ATTRIBUTE_ABSTRACT + count) != null)
1253 infos.add(MemberActionInfo.create((IMember) element, MemberActionInfo.PUSH_ABSTRACT_ACTION));
1254 else if (getAttribute(PushDownRefactoringProcessor.ATTRIBUTE_PUSH + count) != null)
1255 infos.add(MemberActionInfo.create((IMember) element, MemberActionInfo.PUSH_DOWN_ACTION));
1257 infos.add(MemberActionInfo.create((IMember) element, MemberActionInfo.NO_ACTION));
1259 attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1261 pushdownrefactoringprocessor.fMembersToMove= elements.toArray(new IMember[elements.size()]);
1262 pushdownrefactoringprocessor.fMemberInfos= infos.toArray(new MemberActionInfo[infos.size()]);
1265 return new RefactoringStatus();
1268 public RefactoringStatus generated_3410444451013057734(PullUpRefactoringProcessor pulluprefactoringprocessor) {
1269 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1270 if (handle != null) {
1271 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1272 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1273 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, pulluprefactoringprocessor.getProcessorName(), IJavaRefactorings.PULL_UP);
1275 pulluprefactoringprocessor.fDestinationType= (IType) element;
1277 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1278 final String stubs= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_STUBS);
1279 if (stubs != null) {
1280 pulluprefactoringprocessor.fCreateMethodStubs= Boolean.valueOf(stubs).booleanValue();
1282 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_STUBS));
1283 final String instance= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF);
1284 if (instance != null) {
1285 pulluprefactoringprocessor.fInstanceOf= Boolean.valueOf(instance).booleanValue();
1287 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF));
1288 final String replace= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE);
1289 if (replace != null) {
1290 pulluprefactoringprocessor.fReplace= Boolean.valueOf(replace).booleanValue();
1292 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE));
1294 int abstractCount= 0;
1296 String value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT);
1297 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1299 abstractCount= Integer.parseInt(value);
1300 } catch (NumberFormatException exception) {
1301 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT));
1304 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT));
1305 value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_DELETE);
1306 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1308 deleteCount= Integer.parseInt(value);
1309 } catch (NumberFormatException exception) {
1310 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_DELETE));
1313 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_DELETE));
1314 value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_PULL);
1315 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1317 pullCount= Integer.parseInt(value);
1318 } catch (NumberFormatException exception) {
1319 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_PULL));
1322 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_PULL));
1323 final RefactoringStatus status= new RefactoringStatus();
1324 List<IJavaElement> elements= new ArrayList<IJavaElement>();
1325 for (int index= 0; index < pullCount; index++) {
1326 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1);
1327 handle= getAttribute(attribute);
1328 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1329 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1330 if (element == null || !element.exists())
1331 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, pulluprefactoringprocessor.getProcessorName(), IJavaRefactorings.PULL_UP));
1333 elements.add(element);
1335 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1337 pulluprefactoringprocessor.fMembersToMove= elements.toArray(new IMember[elements.size()]);
1338 elements= new ArrayList<IJavaElement>();
1339 for (int index= 0; index < deleteCount; index++) {
1340 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (pullCount + index + 1);
1341 handle= getAttribute(attribute);
1342 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1343 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1344 if (element == null || !element.exists())
1345 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, pulluprefactoringprocessor.getProcessorName(), IJavaRefactorings.PULL_UP));
1347 elements.add(element);
1349 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1351 pulluprefactoringprocessor.fDeletedMethods= elements.toArray(new IMethod[elements.size()]);
1352 elements= new ArrayList<IJavaElement>();
1353 for (int index= 0; index < abstractCount; index++) {
1354 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (pullCount + abstractCount + index + 1);
1355 handle= getAttribute(attribute);
1356 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1357 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1358 if (element == null || !element.exists())
1359 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, pulluprefactoringprocessor.getProcessorName(), IJavaRefactorings.PULL_UP));
1361 elements.add(element);
1363 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1365 pulluprefactoringprocessor.fAbstractMethods= elements.toArray(new IMethod[elements.size()]);
1366 IJavaProject project= null;
1367 if (pulluprefactoringprocessor.fMembersToMove.length > 0)
1368 project= pulluprefactoringprocessor.fMembersToMove[0].getJavaProject();
1369 pulluprefactoringprocessor.fSettings= JavaPreferencesSettings.getCodeGenerationSettings(project);
1372 return new RefactoringStatus();
1375 public RefactoringStatus generated_6800022014899271440(ChangeTypeRefactoring changetyperefactoring) {
1376 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
1377 if (selection != null) {
1380 final StringTokenizer tokenizer= new StringTokenizer(selection);
1381 if (tokenizer.hasMoreTokens())
1382 offset= Integer.valueOf(tokenizer.nextToken()).intValue();
1383 if (tokenizer.hasMoreTokens())
1384 length= Integer.valueOf(tokenizer.nextToken()).intValue();
1385 if (offset >= 0 && length >= 0) {
1386 changetyperefactoring.fSelectionStart= offset;
1387 changetyperefactoring.fSelectionLength= length;
1389 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
1391 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
1392 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1393 if (handle != null) {
1394 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1395 if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
1396 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, changetyperefactoring.getName(), IJavaRefactorings.GENERALIZE_TYPE);
1398 changetyperefactoring.fCu= (ICompilationUnit) element;
1400 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1401 final String type= getAttribute(ChangeTypeRefactoring.ATTRIBUTE_TYPE);
1402 if (type != null && !"".equals(type)) //$NON-NLS-1$
1403 changetyperefactoring.fSelectedTypeName= type;
1405 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeTypeRefactoring.ATTRIBUTE_TYPE));
1406 return new RefactoringStatus();
1409 public RefactoringStatus generated_620139880108189176(ExtractSupertypeProcessor extractsupertypeprocessor) {
1411 final String stubs= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_STUBS);
1412 if (stubs != null) {
1413 extractsupertypeprocessor.fCreateMethodStubs= Boolean.valueOf(stubs).booleanValue();
1415 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_STUBS));
1416 final String instance= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF);
1417 if (instance != null) {
1418 extractsupertypeprocessor.fInstanceOf= Boolean.valueOf(instance).booleanValue();
1420 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF));
1421 final String replace= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE);
1422 if (replace != null) {
1423 extractsupertypeprocessor.fReplace= Boolean.valueOf(replace).booleanValue();
1425 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE));
1426 int extractCount= 0;
1427 int abstractCount= 0;
1430 String value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT);
1431 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1433 abstractCount= Integer.parseInt(value);
1434 } catch (NumberFormatException exception) {
1435 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT));
1438 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT));
1439 value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_DELETE);
1440 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1442 deleteCount= Integer.parseInt(value);
1443 } catch (NumberFormatException exception) {
1444 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_DELETE));
1447 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_DELETE));
1448 value= getAttribute(ExtractSupertypeProcessor.ATTRIBUTE_EXTRACT);
1449 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1451 extractCount= Integer.parseInt(value);
1452 } catch (NumberFormatException exception) {
1453 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractSupertypeProcessor.ATTRIBUTE_EXTRACT));
1456 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractSupertypeProcessor.ATTRIBUTE_EXTRACT));
1457 value= getAttribute(ExtractSupertypeProcessor.ATTRIBUTE_TYPES);
1458 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1460 typeCount= Integer.parseInt(value);
1461 } catch (NumberFormatException exception) {
1462 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractSupertypeProcessor.ATTRIBUTE_TYPES));
1465 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractSupertypeProcessor.ATTRIBUTE_TYPES));
1466 final RefactoringStatus status= new RefactoringStatus();
1467 List<IJavaElement> elements= new ArrayList<IJavaElement>();
1468 for (int index= 0; index < extractCount; index++) {
1469 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1);
1470 handle= getAttribute(attribute);
1471 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1472 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(extractsupertypeprocessor.fOwner, getProject(), handle, false);
1473 if (element == null || !element.exists())
1474 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, extractsupertypeprocessor.getProcessorName(), IJavaRefactorings.EXTRACT_SUPERCLASS));
1476 elements.add(element);
1478 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1480 extractsupertypeprocessor.fMembersToMove= elements.toArray(new IMember[elements.size()]);
1481 elements= new ArrayList<IJavaElement>();
1482 for (int index= 0; index < deleteCount; index++) {
1483 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (extractCount + index + 1);
1484 handle= getAttribute(attribute);
1485 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1486 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(extractsupertypeprocessor.fOwner, getProject(), handle, false);
1487 if (element == null || !element.exists())
1488 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, extractsupertypeprocessor.getProcessorName(), IJavaRefactorings.EXTRACT_SUPERCLASS));
1490 elements.add(element);
1492 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1494 extractsupertypeprocessor.fDeletedMethods= elements.toArray(new IMethod[elements.size()]);
1495 elements= new ArrayList<IJavaElement>();
1496 for (int index= 0; index < abstractCount; index++) {
1497 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (extractCount + abstractCount + index + 1);
1498 handle= getAttribute(attribute);
1499 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1500 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(extractsupertypeprocessor.fOwner, getProject(), handle, false);
1501 if (element == null || !element.exists())
1502 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, extractsupertypeprocessor.getProcessorName(), IJavaRefactorings.EXTRACT_SUPERCLASS));
1504 elements.add(element);
1506 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1508 extractsupertypeprocessor.fAbstractMethods= elements.toArray(new IMethod[elements.size()]);
1509 elements= new ArrayList<IJavaElement>();
1510 for (int index= 0; index < typeCount; index++) {
1511 final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (extractCount + abstractCount + deleteCount + index + 1);
1512 handle= getAttribute(attribute);
1513 if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
1514 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(extractsupertypeprocessor.fOwner, getProject(), handle, false);
1515 if (element == null || !element.exists())
1516 status.merge(JavaRefactoringDescriptorUtil.createInputFatalStatus(element, extractsupertypeprocessor.getProcessorName(), IJavaRefactorings.EXTRACT_SUPERCLASS));
1518 elements.add(element);
1520 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1522 extractsupertypeprocessor.fTypesToExtract= elements.toArray(new IType[elements.size()]);
1523 IJavaProject project= null;
1524 if (extractsupertypeprocessor.fMembersToMove.length > 0)
1525 project= extractsupertypeprocessor.fMembersToMove[0].getJavaProject();
1526 extractsupertypeprocessor.fSettings= JavaPreferencesSettings.getCodeGenerationSettings(project);
1529 return new RefactoringStatus();
1532 public RefactoringStatus generated_2544211072459904186(MoveStaticMembersProcessor movestaticmembersprocessor) {
1533 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1534 if (handle != null) {
1535 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1536 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1537 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, movestaticmembersprocessor.getProcessorName(), IJavaRefactorings.MOVE_STATIC_MEMBERS);
1539 movestaticmembersprocessor.fDestinationType= (IType) element;
1540 movestaticmembersprocessor.fDestinationTypeName= movestaticmembersprocessor.fDestinationType.getFullyQualifiedName();
1543 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1544 final String delegate= getAttribute(MoveStaticMembersProcessor.ATTRIBUTE_DELEGATE);
1545 if (delegate != null) {
1546 movestaticmembersprocessor.fDelegateUpdating= Boolean.valueOf(delegate).booleanValue();
1548 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveStaticMembersProcessor.ATTRIBUTE_DELEGATE));
1549 final String deprecate= getAttribute(MoveStaticMembersProcessor.ATTRIBUTE_DEPRECATE);
1550 if (deprecate != null) {
1551 movestaticmembersprocessor.fDelegateDeprecation= Boolean.valueOf(deprecate).booleanValue();
1553 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveStaticMembersProcessor.ATTRIBUTE_DEPRECATE));
1555 final List<IJavaElement> elements= new ArrayList<IJavaElement>();
1556 String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1557 final RefactoringStatus status= new RefactoringStatus();
1558 while ((handle= getAttribute(attribute)) != null) {
1559 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1560 if (element == null || !element.exists())
1561 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, movestaticmembersprocessor.getProcessorName(), IJavaRefactorings.MOVE_STATIC_MEMBERS));
1563 elements.add(element);
1565 attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1567 movestaticmembersprocessor.fMembersToMove= elements.toArray(new IMember[elements.size()]);
1568 if (elements.isEmpty())
1569 return JavaRefactoringDescriptorUtil.createInputFatalStatus(null, movestaticmembersprocessor.getProcessorName(), IJavaRefactorings.MOVE_STATIC_MEMBERS);
1570 IJavaProject project= null;
1571 if (movestaticmembersprocessor.fMembersToMove.length > 0)
1572 project= movestaticmembersprocessor.fMembersToMove[0].getJavaProject();
1573 movestaticmembersprocessor.fPreferences= JavaPreferencesSettings.getCodeGenerationSettings(project);
1576 return new RefactoringStatus();
1579 public RefactoringStatus generated_500142756939536132(UseSuperTypeProcessor usesupertypeprocessor) {
1580 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1581 if (handle != null) {
1582 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1583 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1584 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, usesupertypeprocessor.getProcessorName(), IJavaRefactorings.USE_SUPER_TYPE);
1586 usesupertypeprocessor.fSubType= (IType) element;
1588 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1589 handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + 1);
1590 if (handle != null) {
1591 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1592 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1593 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, usesupertypeprocessor.getProcessorName(), IJavaRefactorings.USE_SUPER_TYPE);
1595 usesupertypeprocessor.fSuperType= (IType) element;
1597 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + 1));
1598 final String instance= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF);
1599 if (instance != null) {
1600 usesupertypeprocessor.fInstanceOf= Boolean.valueOf(instance).booleanValue();
1602 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF));
1603 return new RefactoringStatus();
1606 public RefactoringStatus generated_7739884842264948662(ChangeSignatureProcessor changesignatureprocessor) {
1607 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1608 if (handle != null) {
1609 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1610 if (element == null || !element.exists() || element.getElementType() != IJavaElement.METHOD)
1611 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, changesignatureprocessor.getProcessorName(), IJavaRefactorings.CHANGE_METHOD_SIGNATURE);
1613 changesignatureprocessor.fMethod= (IMethod) element;
1614 changesignatureprocessor.fMethodName= changesignatureprocessor.fMethod.getElementName();
1616 changesignatureprocessor.fVisibility= JdtFlags.getVisibilityCode(changesignatureprocessor.fMethod);
1617 changesignatureprocessor.fReturnTypeInfo= new ReturnTypeInfo(Signature.toString(Signature.getReturnType(changesignatureprocessor.fMethod.getSignature())));
1618 } catch (JavaModelException exception) {
1619 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { new Integer(changesignatureprocessor.fVisibility),
1620 ChangeSignatureProcessor.ATTRIBUTE_VISIBILITY }));
1624 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1625 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
1627 changesignatureprocessor.fMethodName= name;
1628 final RefactoringStatus status= Checks.checkMethodName(changesignatureprocessor.fMethodName, changesignatureprocessor.fMethod);
1629 if (status.hasError())
1632 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
1633 final String type= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_RETURN);
1634 if (type != null && !"".equals(type)) //$NON-NLS-1$
1635 changesignatureprocessor.fReturnTypeInfo.setNewTypeName(type);
1636 final String visibility= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_VISIBILITY);
1637 if (visibility != null && !"".equals(visibility)) {//$NON-NLS-1$
1640 flag= Integer.parseInt(visibility);
1641 } catch (NumberFormatException exception) {
1642 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeSignatureProcessor.ATTRIBUTE_VISIBILITY));
1644 changesignatureprocessor.fVisibility= flag;
1647 String attribute= ChangeSignatureProcessor.ATTRIBUTE_PARAMETER + count;
1649 changesignatureprocessor.fParameterInfos= new ArrayList<ParameterInfo>(3);
1650 while ((value= getAttribute(attribute)) != null) {
1651 StringTokenizer tokenizer= new StringTokenizer(value, " "); //$NON-NLS-1$
1652 if (tokenizer.countTokens() < 6)
1653 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { value, ChangeSignatureProcessor.ATTRIBUTE_PARAMETER }));
1654 String oldTypeName= tokenizer.nextToken();
1655 String oldName= tokenizer.nextToken();
1656 String oldIndex= tokenizer.nextToken();
1657 String newTypeName= tokenizer.nextToken();
1658 String newName= tokenizer.nextToken();
1659 String deleted= tokenizer.nextToken();
1660 ParameterInfo info= null;
1662 int index= Integer.parseInt(oldIndex);
1664 String result= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_DEFAULT + count);
1666 result= ""; //$NON-NLS-1$
1667 info= ParameterInfo.createInfoForAddedParameter(newTypeName, newName, result);
1669 info= new ParameterInfo(oldTypeName, oldName, index);
1670 info.setNewTypeName(newTypeName);
1671 info.setNewName(newName);
1672 if (Boolean.valueOf(deleted).booleanValue())
1673 info.markAsDeleted();
1675 changesignatureprocessor.fParameterInfos.add(info);
1676 } catch (NumberFormatException exception) {
1677 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { value, ChangeSignatureProcessor.ATTRIBUTE_PARAMETER }));
1680 attribute= ChangeSignatureProcessor.ATTRIBUTE_PARAMETER + count;
1683 changesignatureprocessor.fExceptionInfos= new ArrayList<ExceptionInfo>(2);
1684 attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1685 while ((value= getAttribute(attribute)) != null) {
1686 ExceptionInfo info= null;
1687 final String kind= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_KIND + count);
1689 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), value, false);
1690 if (element == null || !element.exists())
1691 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, changesignatureprocessor.getProcessorName(), IJavaRefactorings.CHANGE_METHOD_SIGNATURE);
1694 info= new ExceptionInfo(element, Integer.valueOf(kind).intValue(), null);
1695 } catch (NumberFormatException exception) {
1696 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { kind, ChangeSignatureProcessor.ATTRIBUTE_KIND }));
1700 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { kind, ChangeSignatureProcessor.ATTRIBUTE_KIND }));
1701 changesignatureprocessor.fExceptionInfos.add(info);
1703 attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1705 final String deprecate= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_DEPRECATE);
1706 if (deprecate != null) {
1707 changesignatureprocessor.fDelegateDeprecation= Boolean.valueOf(deprecate).booleanValue();
1709 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeSignatureProcessor.ATTRIBUTE_DEPRECATE));
1710 final String delegate= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_DELEGATE);
1711 if (delegate != null) {
1712 changesignatureprocessor.fDelegateUpdating= Boolean.valueOf(delegate).booleanValue();
1714 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeSignatureProcessor.ATTRIBUTE_DELEGATE));
1715 return new RefactoringStatus();
1718 public RefactoringStatus generated_6259162452256659312(MoveInnerToTopRefactoring moveinnertotoprefactoring) {
1719 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1720 if (handle != null) {
1721 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1722 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1723 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, moveinnertotoprefactoring.getName(), IJavaRefactorings.CONVERT_MEMBER_TYPE);
1725 moveinnertotoprefactoring.fType= (IType) element;
1726 moveinnertotoprefactoring.fCodeGenerationSettings= JavaPreferencesSettings.getCodeGenerationSettings(moveinnertotoprefactoring.fType.getJavaProject());
1728 moveinnertotoprefactoring.initialize();
1729 } catch (JavaModelException exception) {
1730 JavaPlugin.log(exception);
1734 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1735 final String fieldName= getAttribute(MoveInnerToTopRefactoring.ATTRIBUTE_FIELD_NAME);
1736 if (fieldName != null && !"".equals(fieldName)) //$NON-NLS-1$
1737 moveinnertotoprefactoring.fEnclosingInstanceFieldName= fieldName;
1738 final String parameterName= getAttribute(MoveInnerToTopRefactoring.ATTRIBUTE_PARAMETER_NAME);
1739 if (parameterName != null && !"".equals(parameterName)) //$NON-NLS-1$
1740 moveinnertotoprefactoring.fNameForEnclosingInstanceConstructorParameter= parameterName;
1741 final String createField= getAttribute(MoveInnerToTopRefactoring.ATTRIBUTE_FIELD);
1742 if (createField != null) {
1743 moveinnertotoprefactoring.fCreateInstanceField= Boolean.valueOf(createField).booleanValue();
1745 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveInnerToTopRefactoring.ATTRIBUTE_FIELD));
1746 final String markFinal= getAttribute(MoveInnerToTopRefactoring.ATTRIBUTE_FINAL);
1747 if (markFinal != null) {
1748 moveinnertotoprefactoring.fMarkInstanceFieldAsFinal= Boolean.valueOf(markFinal).booleanValue();
1750 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveInnerToTopRefactoring.ATTRIBUTE_FINAL));
1751 final String possible= getAttribute(MoveInnerToTopRefactoring.ATTRIBUTE_POSSIBLE);
1752 if (possible != null) {
1753 moveinnertotoprefactoring.fIsInstanceFieldCreationPossible= Boolean.valueOf(possible).booleanValue();
1755 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveInnerToTopRefactoring.ATTRIBUTE_POSSIBLE));
1756 final String mandatory= getAttribute(MoveInnerToTopRefactoring.ATTRIBUTE_MANDATORY);
1757 if (mandatory != null)
1758 moveinnertotoprefactoring.fIsInstanceFieldCreationMandatory= Boolean.valueOf(mandatory).booleanValue();
1760 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveInnerToTopRefactoring.ATTRIBUTE_MANDATORY));
1761 return new RefactoringStatus();
1764 public RefactoringStatus generated_1163771170022304128(ExtractInterfaceProcessor extractinterfaceprocessor) {
1765 String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
1766 if (handle != null) {
1767 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1768 if (element == null || !element.exists() || element.getElementType() != IJavaElement.TYPE)
1769 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, extractinterfaceprocessor.getProcessorName(), IJavaRefactorings.EXTRACT_INTERFACE);
1771 extractinterfaceprocessor.fSubType= (IType) element;
1773 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1774 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
1776 extractinterfaceprocessor.fSuperName= name;
1777 final RefactoringStatus status= extractinterfaceprocessor.checkTypeName(name);
1778 if (status.hasError())
1781 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
1782 final String deferred= getAttribute(ExtractInterfaceProcessor.ATTRIBUTE_ABSTRACT);
1783 if (deferred != null) {
1784 extractinterfaceprocessor.fAbstract= Boolean.valueOf(deferred).booleanValue();
1786 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractInterfaceProcessor.ATTRIBUTE_ABSTRACT));
1787 final String comment= getAttribute(ExtractInterfaceProcessor.ATTRIBUTE_COMMENTS);
1788 if (comment != null) {
1789 extractinterfaceprocessor.fComments= Boolean.valueOf(comment).booleanValue();
1791 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractInterfaceProcessor.ATTRIBUTE_COMMENTS));
1792 final String instance= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF);
1793 if (instance != null) {
1794 extractinterfaceprocessor.fInstanceOf= Boolean.valueOf(instance).booleanValue();
1796 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF));
1797 final String visibility= getAttribute(ExtractInterfaceProcessor.ATTRIBUTE_PUBLIC);
1798 if (visibility != null) {
1799 extractinterfaceprocessor.fPublic= Boolean.valueOf(visibility).booleanValue();
1801 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractInterfaceProcessor.ATTRIBUTE_PUBLIC));
1802 final String replace= getAttribute(SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE);
1803 if (replace != null) {
1804 extractinterfaceprocessor.fReplace= Boolean.valueOf(replace).booleanValue();
1806 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE));
1808 final List<IJavaElement> elements= new ArrayList<IJavaElement>();
1809 String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1810 final RefactoringStatus status= new RefactoringStatus();
1811 while ((handle= getAttribute(attribute)) != null) {
1812 final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(getProject(), handle, false);
1813 if (element == null || !element.exists())
1814 status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, extractinterfaceprocessor.getProcessorName(), IJavaRefactorings.EXTRACT_INTERFACE));
1816 elements.add(element);
1818 attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1820 extractinterfaceprocessor.fMembers= elements.toArray(new IMember[elements.size()]);
1821 extractinterfaceprocessor.fSettings= JavaPreferencesSettings.getCodeGenerationSettings(extractinterfaceprocessor.fSubType.getJavaProject());
1824 return new RefactoringStatus();