]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/JavaRefactoringArguments.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / core refactoring / org / eclipse / jdt / internal / corext / refactoring / JavaRefactoringArguments.java
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
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.corext.refactoring;
12
13 import java.util.ArrayList;
14 import java.util.List;
15 import java.util.Map;
16 import java.util.StringTokenizer;
17
18 import org.eclipse.core.runtime.CoreException;
19 import org.eclipse.core.runtime.IAdaptable;
20 import org.eclipse.core.runtime.Path;
21
22 import org.eclipse.core.resources.IResource;
23 import org.eclipse.core.resources.ResourcesPlugin;
24
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;
29
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;
48
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;
97
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;
102
103 /**
104  * A wrapper around the Map received from {@link JavaRefactoringDescriptor} to access and convert
105  * the options.
106  */
107 public final class JavaRefactoringArguments {
108
109         /** The attribute map (element type: <code>&lt;String, String&gt;</code>) */
110         private final Map<String, String> fAttributes;
111
112         /** The name of the project, or <code>null</code> for the workspace */
113         private String fProject;
114
115         /**
116          * Creates a new java refactoring arguments from arguments
117          *
118          * @param project
119          *            the project, or <code>null</code> for the workspace
120          * @param arguments
121          *            the arguments
122          */
123         public JavaRefactoringArguments(String project, Map<String, String> arguments) {
124                 fProject= project;
125                 fAttributes= arguments;
126         }
127
128         /**
129          * Returns the attribute with the specified name.
130          *
131          * @param name
132          *            the name of the attribute
133          * @return the attribute value, or <code>null</code>
134          */
135         public String getAttribute(final String name) {
136                 return fAttributes.get(name);
137         }
138
139         /**
140          * Returns the name of the project.
141          *
142          * @return the name of the project, or <code>null</code> for the workspace
143          */
144         public String getProject() {
145                 return fProject;
146         }
147
148         /**
149          * {@inheritDoc}
150          */
151         @Override
152         public String toString() {
153                 return getClass().getName() + fAttributes.toString();
154         }
155
156         public RefactoringStatus generated_7356054422577277715(ExtractConstantRefactoring extractconstantrefactoring) {
157                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
158                 if (selection != null) {
159                         int offset= -1;
160                         int length= -1;
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;
169                         } else
170                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
171                 } else
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);
178                         else
179                                 extractconstantrefactoring.fCu= (ICompilationUnit) element;
180                 } else
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$
184                         int flag= 0;
185                         try {
186                                 flag= Integer.parseInt(visibility);
187                         } catch (NumberFormatException exception) {
188                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractConstantRefactoring.ATTRIBUTE_VISIBILITY));
189                         }
190                         extractconstantrefactoring.fVisibility= JdtFlags.getVisibilityString(flag);
191                 }
192                 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
193                 if (name != null && !"".equals(name)) //$NON-NLS-1$
194                         extractconstantrefactoring.fConstantName= name;
195                 else
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();
200                 } else
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();
205                 } else
206                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractConstantRefactoring.ATTRIBUTE_QUALIFY));
207                 return new RefactoringStatus();
208         }
209
210         public RefactoringStatus generated_8698951336202486639(ExtractTempRefactoring extracttemprefactoring) {
211                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
212                 if (selection != null) {
213                         int offset= -1;
214                         int length= -1;
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;
223                         } else
224                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
225                 } else
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);
232                         else
233                                 extracttemprefactoring.fCu= (ICompilationUnit) element;
234                 } else
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;
239                 else
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();
244                 } else
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();
249                 } else
250                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractTempRefactoring.ATTRIBUTE_FINAL));
251                 return new RefactoringStatus();
252         }
253
254         public RefactoringStatus generated_8748163025498223751(IntroduceParameterRefactoring introduceparameterrefactoring) {
255                 introduceparameterrefactoring.fArguments= this;
256                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
257                 if (selection != null) {
258                         int offset= -1;
259                         int length= -1;
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;
268                         } else
269                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
270                 } else
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);
277                         else
278                                 introduceparameterrefactoring.fSourceCU= (ICompilationUnit)element;
279                 } else
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;
284                 else
285                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, IntroduceParameterRefactoring.ATTRIBUTE_ARGUMENT));
286                 return new RefactoringStatus();
287         }
288
289         public RefactoringStatus generated_241571537466594463(InlineConstantRefactoring inlineconstantrefactoring) {
290                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
291                 if (selection != null) {
292                         int offset= -1;
293                         int length= -1;
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;
302                         } else
303                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
304                 }
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);
310                         else {
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;
317                                         try {
318                                                 final ISourceRange range= field.getNameRange();
319                                                 if (range != null) {
320                                                         inlineconstantrefactoring.fSelectionStart= range.getOffset();
321                                                         inlineconstantrefactoring.fSelectionLength= range.getLength();
322                                                 } else
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);
326                                         }
327                                         inlineconstantrefactoring.fSelectionCu= field.getCompilationUnit();
328                                 } else
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);
337                         }
338                 } else
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();
343                 } else
344                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InlineConstantRefactoring.ATTRIBUTE_REPLACE));
345                 final String remove= getAttribute(InlineConstantRefactoring.ATTRIBUTE_REMOVE);
346                 if (remove != null)
347                         inlineconstantrefactoring.fRemoveDeclaration= Boolean.valueOf(remove).booleanValue();
348                 else
349                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InlineConstantRefactoring.ATTRIBUTE_REMOVE));
350                 return new RefactoringStatus();
351         }
352
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));
357         
358                 int offset= -1;
359                 int length= -1;
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}));
367         
368                 extractmethodrefactoring.fSelectionStart= offset;
369                 extractmethodrefactoring.fSelectionLength= length;
370         
371                 final String handle= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
372                 if (handle == null)
373                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
374         
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);
378         
379                 extractmethodrefactoring.fCUnit= (ICompilationUnit) element;
380                 final String visibility= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_VISIBILITY);
381                 if (visibility != null && visibility.length() != 0) {
382                         int flag= 0;
383                         try {
384                                 flag= Integer.parseInt(visibility);
385                         } catch (NumberFormatException exception) {
386                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_VISIBILITY));
387                         }
388                         extractmethodrefactoring.fVisibility= flag;
389                 }
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));
393         
394                 extractmethodrefactoring.fMethodName= name;
395         
396                 final String destination= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_DESTINATION);
397                 if (destination != null && destination.length() == 0) {
398                         int index= 0;
399                         try {
400                                 index= Integer.parseInt(destination);
401                         } catch (NumberFormatException exception) {
402                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_DESTINATION));
403                         }
404                         extractmethodrefactoring.fDestinationIndex= index;
405                 }
406                 final String replace= getAttribute(ExtractMethodRefactoring.ATTRIBUTE_REPLACE);
407                 if (replace == null)
408                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractMethodRefactoring.ATTRIBUTE_REPLACE));
409         
410                 extractmethodrefactoring.fReplaceDuplicates= Boolean.valueOf(replace).booleanValue();
411         
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));
415         
416                 extractmethodrefactoring.fGenerateJavadoc= Boolean.valueOf(comments).booleanValue();
417         
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));
421         
422                 extractmethodrefactoring.fThrowRuntimeExceptions= Boolean.valueOf(exceptions).booleanValue();
423         
424                 return new RefactoringStatus();
425         }
426
427         public RefactoringStatus generated_2570321746173001286(IntroduceFactoryRefactoring introducefactoryrefactoring) {
428                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
429                 if (selection != null) {
430                         int offset= -1;
431                         int length= -1;
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;
440                         } else
441                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
442                 } else
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);
449                         else {
450                                 introducefactoryrefactoring.fCUHandle= (ICompilationUnit) element;
451                         introducefactoryrefactoring.initialize();
452                         }
453                 } else
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);
460                         else {
461                                 final IType type= (IType) element;
462                                 introducefactoryrefactoring.fFactoryClassName= type.getFullyQualifiedName();
463                         }
464                 } else
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;
469                 else
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();
474                 } else
475                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, IntroduceFactoryRefactoring.ATTRIBUTE_PROTECT));
476                 return new RefactoringStatus();
477         }
478
479         public RefactoringStatus generated_433400260767030263(InlineTempRefactoring inlinetemprefactoring) {
480                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
481                 if (selection != null) {
482                         int offset= -1;
483                         int length= -1;
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;
492                         } else
493                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
494                 } else
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);
501                         else {
502                                 inlinetemprefactoring.fCu= (ICompilationUnit) element;
503                         if (inlinetemprefactoring.checkIfTempSelected().hasFatalError())
504                                         return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, inlinetemprefactoring.getName(), IJavaRefactorings.INLINE_LOCAL_VARIABLE);
505                         }
506                 } else
507                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
508                 return new RefactoringStatus();
509         }
510
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);
517                         else
518                                 introduceindirectionrefactoring.fTargetMethod= (IMethod) element;
519                 } else
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);
526                         else
527                                 introduceindirectionrefactoring.fIntermediaryClass= (IType) element;
528                 } else
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();
533                 } else
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);
538                 else
539                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));
540         }
541
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);
549                         else {
550                                 convertanonymoustonestedrefactoring.fCu= (ICompilationUnit) element;
551                         }
552                 } else
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;
557                 else
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$
561                         int flag= 0;
562                         try {
563                                 flag= Integer.parseInt(visibility);
564                         } catch (NumberFormatException exception) {
565                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ConvertAnonymousToNestedRefactoring.ATTRIBUTE_VISIBILITY));
566                         }
567                         convertanonymoustonestedrefactoring.fVisibility= flag;
568                 }
569                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
570                 if (selection != null) {
571                         int offset= -1;
572                         int length= -1;
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;
581                         } else
582                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
583                 } else
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();
588                 } else
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();
593                 } else
594                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ConvertAnonymousToNestedRefactoring.ATTRIBUTE_FINAL));
595                 return new RefactoringStatus();
596         }
597
598         public RefactoringStatus generated_2404816089335359482(PromoteTempToFieldRefactoring promotetemptofieldrefactoring) {
599                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
600                 if (selection != null) {
601                         int offset= -1;
602                         int length= -1;
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;
611                         } else
612                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
613                 } else
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);
620                         else
621                                 promotetemptofieldrefactoring.fCu= (ICompilationUnit) element;
622                 } else
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$
626                         int flag= 0;
627                         try {
628                                 flag= Integer.parseInt(visibility);
629                         } catch (NumberFormatException exception) {
630                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_VISIBILITY));
631                         }
632                         promotetemptofieldrefactoring.fVisibility= flag;
633                 }
634                 final String initialize= getAttribute(PromoteTempToFieldRefactoring.ATTRIBUTE_INITIALIZE);
635                 if (initialize != null && !"".equals(initialize)) {//$NON-NLS-1$
636                         int value= 0;
637                         try {
638                                 value= Integer.parseInt(initialize);
639                         } catch (NumberFormatException exception) {
640                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_INITIALIZE));
641                         }
642                         promotetemptofieldrefactoring.fInitializeIn= value;
643                 }
644                 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
645                 if (name != null && !"".equals(name)) //$NON-NLS-1$
646                         promotetemptofieldrefactoring.fFieldName= name;
647                 else
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();
652                 } else
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();
657                 } else
658                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PromoteTempToFieldRefactoring.ATTRIBUTE_FINAL));
659                 return new RefactoringStatus();
660         }
661
662         public RefactoringStatus generated_8680542984146802295(InferTypeArgumentsRefactoring infertypeargumentsrefactoring) {
663                 final String clone= getAttribute(InferTypeArgumentsRefactoring.ATTRIBUTE_CLONE);
664                 if (clone != null) {
665                         infertypeargumentsrefactoring.fAssumeCloneReturnsSameType= Boolean.valueOf(clone).booleanValue();
666                 } else
667                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InferTypeArgumentsRefactoring.ATTRIBUTE_CLONE));
668                 final String leave= getAttribute(InferTypeArgumentsRefactoring.ATTRIBUTE_LEAVE);
669                 if (leave != null) {
670                         infertypeargumentsrefactoring.fLeaveUnconstrainedRaw= Boolean.valueOf(leave).booleanValue();
671                 } else
672                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, InferTypeArgumentsRefactoring.ATTRIBUTE_LEAVE));
673                 int count= 1;
674                 final List<IJavaElement> elements= new ArrayList<IJavaElement>();
675                 String handle= null;
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);
682                         else
683                                 elements.add(element);
684                         count++;
685                         attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
686                 }
687                 infertypeargumentsrefactoring.fElements= elements.toArray(new IJavaElement[elements.size()]);
688                 if (elements.isEmpty())
689                         return JavaRefactoringDescriptorUtil.createInputFatalStatus(null, infertypeargumentsrefactoring.getName(), IJavaRefactorings.INFER_TYPE_ARGUMENTS);
690                 if (!status.isOK())
691                         return status;
692                 return new RefactoringStatus();
693         }
694
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);
707                                 } else
708                                         return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
709                         } else
710                                 return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
711                 } else
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);
716                 else
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) {
721                                 int offset= -1;
722                                 int length= -1;
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) {
729                                         try {
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;
736                                                         }
737                                                 }
738                                                 if (renamelocalvariableprocessor.fLocalVariable == null)
739                                                         return JavaRefactoringDescriptorUtil.createInputFatalStatus(null, renamelocalvariableprocessor.getProcessorName(), IJavaRefactorings.RENAME_LOCAL_VARIABLE);
740                                         } catch (JavaModelException exception) {
741                                                 JavaPlugin.log(exception);
742                                         }
743                                 } else
744                                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection,
745                                                         JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION }));
746                         } else
747                                 return RefactoringStatus
748                                                 .createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));
749                 }
750                 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
751                 if (references != null) {
752                         renamelocalvariableprocessor.fUpdateReferences= Boolean.valueOf(references).booleanValue();
753                 } else
754                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
755                 return new RefactoringStatus();
756         }
757
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);
767                         else {
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);
772                                 else
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);
777                         }
778                 } else
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);
783                 else
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();
788                 } else
789                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
790                 return new RefactoringStatus();
791         }
792
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);
799                         else
800                                 renametypeprocessor.fType= (IType) element;
801                 } else
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);
806                 else
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();
814                 } else
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();
819                 } else
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();
824                 } else
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();
829                 else
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) {
833                         try {
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 }));
838                         }
839                 } else
840                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameTypeProcessor.ATTRIBUTE_MATCHING_STRATEGY));
841                 return new RefactoringStatus();
842         }
843
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);
848                 else
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();
853                 } else
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();
858                 } else
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();
863                 } else
864                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameMethodProcessor.ATTRIBUTE_DEPRECATE));
865                 return new RefactoringStatus();
866         }
867
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);
874                         else
875                                 renamefieldprocessor.fField= (IField) element;
876                 } else
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);
881                 else
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();
886                 } else
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();
891                 } else
892                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameFieldProcessor.ATTRIBUTE_TEXTUAL_MATCHES));
893                 final String getters= getAttribute(RenameFieldProcessor.ATTRIBUTE_RENAME_GETTER);
894                 if (getters != null)
895                         renamefieldprocessor.fRenameGetter= Boolean.valueOf(getters).booleanValue();
896                 else
897                         renamefieldprocessor.fRenameGetter= false;
898                 final String setters= getAttribute(RenameFieldProcessor.ATTRIBUTE_RENAME_SETTER);
899                 if (setters != null)
900                         renamefieldprocessor.fRenameSetter= Boolean.valueOf(setters).booleanValue();
901                 else
902                         renamefieldprocessor.fRenameSetter= false;
903                 final String delegate= getAttribute(RenameFieldProcessor.ATTRIBUTE_DELEGATE);
904                 if (delegate != null) {
905                         renamefieldprocessor.fDelegateUpdating= Boolean.valueOf(delegate).booleanValue();
906                 } else
907                         renamefieldprocessor.fDelegateUpdating= false;
908                 final String deprecate= getAttribute(RenameFieldProcessor.ATTRIBUTE_DEPRECATE);
909                 if (deprecate != null) {
910                         renamefieldprocessor.fDelegateDeprecation= Boolean.valueOf(deprecate).booleanValue();
911                 } else
912                         renamefieldprocessor.fDelegateDeprecation= false;
913                 return new RefactoringStatus();
914         }
915
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));
920                 }
921         
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);
925         
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));
929         
930                 renamecompilationunitprocessor.fCu= (ICompilationUnit) element;
931                 try {
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);
937                 }
938                 return new RefactoringStatus();
939         }
940
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);
947                         else
948                                 renameenumconstprocessor.fField= (IField) element;
949                 } else
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);
954                 else
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());
959                 } else
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());
964                 } else
965                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameFieldProcessor.ATTRIBUTE_TEXTUAL_MATCHES));
966                 return new RefactoringStatus();
967         }
968
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);
975                         else
976                                 renamepackageprocessor.fPackage= (IPackageFragment) element;
977                 } else
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);
982                 else
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;
987                 else
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();
992                 } else
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();
997                 } else
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();
1002                 } else
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();
1007                 } else
1008                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenamePackageProcessor.ATTRIBUTE_HIERARCHICAL));
1009                 return new RefactoringStatus();
1010         }
1011
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);
1018                         else
1019                                 renamejavaprojectprocessor.fProject= (IJavaProject) element;
1020                 } else
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);
1025                 else
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();
1030                 } else
1031                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));
1032                 return new RefactoringStatus();
1033         }
1034
1035         public RefactoringStatus generated_4798413625482765856(RenameSourceFolderProcessor renamesourcefolderprocessor) {
1036                 final String path= getAttribute(RenameSourceFolderProcessor.ATTRIBUTE_PATH);
1037                 if (path != null) {
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);
1041                         else
1042                                 renamesourcefolderprocessor.fSourceFolder= (IPackageFragmentRoot) JavaCore.create(resource);
1043                 } else
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);
1048                 else
1049                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, RenameSourceFolderProcessor.ATTRIBUTE_NAME));
1050                 return new RefactoringStatus();
1051         }
1052
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));
1062                         }
1063                 }
1064                 return status;
1065         }
1066
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;
1071                 else
1072                         movefilesfoldersandcuspolicy.fFilePatterns= ""; //$NON-NLS-1$
1073                 final String references= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);
1074                 return references;
1075         }
1076
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);
1084                         }
1085                         status.merge(javamoveprocessor.fMovePolicy.initialize(this));
1086                 }
1087         }
1088
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();
1094                 } else
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();
1099                 } else
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$
1105                         try {
1106                                 resourceCount= Integer.parseInt(value);
1107                         } catch (NumberFormatException exception) {
1108                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_RESOURCES));
1109                         }
1110                 } else
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$
1114                         try {
1115                                 elementCount= Integer.parseInt(value);
1116                         } catch (NumberFormatException exception) {
1117                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaDeleteProcessor.ATTRIBUTE_ELEMENTS));
1118                         }
1119                 } else
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));
1130                                 else
1131                                         elements.add(resource);
1132                         } else
1133                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1134                 }
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));
1144                                 else
1145                                         elements.add(element);
1146                         } else
1147                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1148                 }
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);
1153                 return status;
1154         }
1155
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 }));
1161                         return null;
1162                 }
1163         
1164                 JavaRenameProcessor processor;
1165                 if (MethodChecks.isVirtual(method)) {
1166                         processor= new RenameVirtualMethodProcessor(method, this, status);
1167                 } else {
1168                         processor= new RenameNonVirtualMethodProcessor(method, this, status);
1169                 }
1170                 return new RenameRefactoring(processor);
1171         }
1172
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);
1179                         else {
1180                                 selfencapsulatefieldrefactoring.fField= (IField) element;
1181                                 try {
1182                                         selfencapsulatefieldrefactoring.initialize(selfencapsulatefieldrefactoring.fField);
1183                                 } catch (JavaModelException exception) {
1184                                         return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, selfencapsulatefieldrefactoring.getName(), IJavaRefactorings.ENCAPSULATE_FIELD);
1185                                 }
1186                         }
1187                 } else
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;
1192                 else
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;
1197                 else
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();
1202                 } else
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();
1207                 } else
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$
1211                         int flag= 0;
1212                         try {
1213                                 flag= Integer.parseInt(visibility);
1214                         } catch (NumberFormatException exception) {
1215                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_VISIBILITY));
1216                         }
1217                         selfencapsulatefieldrefactoring.fVisibility= flag;
1218                 }
1219                 final String insertion= getAttribute(SelfEncapsulateFieldRefactoring.ATTRIBUTE_INSERTION);
1220                 if (insertion != null && !"".equals(insertion)) {//$NON-NLS-1$
1221                         int index= 0;
1222                         try {
1223                                 index= Integer.parseInt(insertion);
1224                         } catch (NumberFormatException exception) {
1225                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SelfEncapsulateFieldRefactoring.ATTRIBUTE_INSERTION));
1226                         }
1227                         selfencapsulatefieldrefactoring.fInsertionIndex= index;
1228                 }
1229                 return new RefactoringStatus();
1230         }
1231
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);
1238                         else
1239                                 pushdownrefactoringprocessor.fCachedDeclaringType= (IType) element;
1240                 }
1241                 int count= 1;
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));
1250                         else
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));
1256                         else
1257                                 infos.add(MemberActionInfo.create((IMember) element, MemberActionInfo.NO_ACTION));
1258                         count++;
1259                         attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1260                 }
1261                 pushdownrefactoringprocessor.fMembersToMove= elements.toArray(new IMember[elements.size()]);
1262                 pushdownrefactoringprocessor.fMemberInfos= infos.toArray(new MemberActionInfo[infos.size()]);
1263                 if (!status.isOK())
1264                         return status;
1265                 return new RefactoringStatus();
1266         }
1267
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);
1274                         else
1275                                 pulluprefactoringprocessor.fDestinationType= (IType) element;
1276                 } else
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();
1281                 } else
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();
1286                 } else
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();
1291                 } else
1292                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE));
1293                 int pullCount= 0;
1294                 int abstractCount= 0;
1295                 int deleteCount= 0;
1296                 String value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT);
1297                 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1298                         try {
1299                                 abstractCount= Integer.parseInt(value);
1300                         } catch (NumberFormatException exception) {
1301                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT));
1302                         }
1303                 } else
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$
1307                         try {
1308                                 deleteCount= Integer.parseInt(value);
1309                         } catch (NumberFormatException exception) {
1310                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_DELETE));
1311                         }
1312                 } else
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$
1316                         try {
1317                                 pullCount= Integer.parseInt(value);
1318                         } catch (NumberFormatException exception) {
1319                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_PULL));
1320                         }
1321                 } else
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));
1332                                 else
1333                                         elements.add(element);
1334                         } else
1335                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1336                 }
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));
1346                                 else
1347                                         elements.add(element);
1348                         } else
1349                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1350                 }
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));
1360                                 else
1361                                         elements.add(element);
1362                         } else
1363                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1364                 }
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);
1370                 if (!status.isOK())
1371                         return status;
1372                 return new RefactoringStatus();
1373         }
1374
1375         public RefactoringStatus generated_6800022014899271440(ChangeTypeRefactoring changetyperefactoring) {
1376                 final String selection= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);
1377                 if (selection != null) {
1378                         int offset= -1;
1379                         int length= -1;
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;
1388                         } else
1389                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION}));
1390                 } else
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);
1397                         else
1398                                 changetyperefactoring.fCu= (ICompilationUnit) element;
1399                 } else
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;
1404                 else
1405                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeTypeRefactoring.ATTRIBUTE_TYPE));
1406                 return new RefactoringStatus();
1407         }
1408
1409         public RefactoringStatus generated_620139880108189176(ExtractSupertypeProcessor extractsupertypeprocessor) {
1410                 String handle;
1411                 final String stubs= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_STUBS);
1412                 if (stubs != null) {
1413                         extractsupertypeprocessor.fCreateMethodStubs= Boolean.valueOf(stubs).booleanValue();
1414                 } else
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();
1419                 } else
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();
1424                 } else
1425                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE));
1426                 int extractCount= 0;
1427                 int abstractCount= 0;
1428                 int deleteCount= 0;
1429                 int typeCount= 0;
1430                 String value= getAttribute(PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT);
1431                 if (value != null && !"".equals(value)) {//$NON-NLS-1$
1432                         try {
1433                                 abstractCount= Integer.parseInt(value);
1434                         } catch (NumberFormatException exception) {
1435                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_ABSTRACT));
1436                         }
1437                 } else
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$
1441                         try {
1442                                 deleteCount= Integer.parseInt(value);
1443                         } catch (NumberFormatException exception) {
1444                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, PullUpRefactoringProcessor.ATTRIBUTE_DELETE));
1445                         }
1446                 } else
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$
1450                         try {
1451                                 extractCount= Integer.parseInt(value);
1452                         } catch (NumberFormatException exception) {
1453                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractSupertypeProcessor.ATTRIBUTE_EXTRACT));
1454                         }
1455                 } else
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$
1459                         try {
1460                                 typeCount= Integer.parseInt(value);
1461                         } catch (NumberFormatException exception) {
1462                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ExtractSupertypeProcessor.ATTRIBUTE_TYPES));
1463                         }
1464                 } else
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));
1475                                 else
1476                                         elements.add(element);
1477                         } else
1478                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1479                 }
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));
1489                                 else
1490                                         elements.add(element);
1491                         } else
1492                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1493                 }
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));
1503                                 else
1504                                         elements.add(element);
1505                         } else
1506                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1507                 }
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));
1517                                 else
1518                                         elements.add(element);
1519                         } else
1520                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
1521                 }
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);
1527                 if (!status.isOK())
1528                         return status;
1529                 return new RefactoringStatus();
1530         }
1531
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);
1538                         else {
1539                                 movestaticmembersprocessor.fDestinationType= (IType) element;
1540                                 movestaticmembersprocessor.fDestinationTypeName= movestaticmembersprocessor.fDestinationType.getFullyQualifiedName();
1541                         }
1542                 } else
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();
1547                 } else
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();
1552                 } else
1553                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveStaticMembersProcessor.ATTRIBUTE_DEPRECATE));
1554                 int count= 1;
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));
1562                         else
1563                                 elements.add(element);
1564                         count++;
1565                         attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1566                 }
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);
1574                 if (!status.isOK())
1575                         return status;
1576                 return new RefactoringStatus();
1577         }
1578
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);
1585                         else
1586                                 usesupertypeprocessor.fSubType= (IType) element;
1587                 } else
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);
1594                         else
1595                                 usesupertypeprocessor.fSuperType= (IType) element;
1596                 } else
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();
1601                 } else
1602                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_INSTANCEOF));
1603                 return new RefactoringStatus();
1604         }
1605
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);
1612                         else {
1613                                 changesignatureprocessor.fMethod= (IMethod) element;
1614                                 changesignatureprocessor.fMethodName= changesignatureprocessor.fMethod.getElementName();
1615                                 try {
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 }));
1621                                 }
1622                         }
1623                 } else
1624                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1625                 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
1626                 if (name != null) {
1627                         changesignatureprocessor.fMethodName= name;
1628                         final RefactoringStatus status= Checks.checkMethodName(changesignatureprocessor.fMethodName, changesignatureprocessor.fMethod);
1629                         if (status.hasError())
1630                                 return status;
1631                 } else
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$
1638                         int flag= 0;
1639                         try {
1640                                 flag= Integer.parseInt(visibility);
1641                         } catch (NumberFormatException exception) {
1642                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeSignatureProcessor.ATTRIBUTE_VISIBILITY));
1643                         }
1644                         changesignatureprocessor.fVisibility= flag;
1645                 }
1646                 int count= 1;
1647                 String attribute= ChangeSignatureProcessor.ATTRIBUTE_PARAMETER + count;
1648                 String value= null;
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;
1661                         try {
1662                                 int index= Integer.parseInt(oldIndex);
1663                                 if (index == -1) {
1664                                         String result= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_DEFAULT + count);
1665                                         if (result == null)
1666                                                 result= ""; //$NON-NLS-1$
1667                                         info= ParameterInfo.createInfoForAddedParameter(newTypeName, newName, result);
1668                                 } else {
1669                                         info= new ParameterInfo(oldTypeName, oldName, index);
1670                                         info.setNewTypeName(newTypeName);
1671                                         info.setNewName(newName);
1672                                         if (Boolean.valueOf(deleted).booleanValue())
1673                                                 info.markAsDeleted();
1674                                 }
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 }));
1678                         }
1679                         count++;
1680                         attribute= ChangeSignatureProcessor.ATTRIBUTE_PARAMETER + count;
1681                 }
1682                 count= 1;
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);
1688                         if (kind != null) {
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);
1692                                 else {
1693                                         try {
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 }));
1697                                         }
1698                                 }
1699                         } else
1700                                 return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { kind, ChangeSignatureProcessor.ATTRIBUTE_KIND }));
1701                         changesignatureprocessor.fExceptionInfos.add(info);
1702                         count++;
1703                         attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1704                 }
1705                 final String deprecate= getAttribute(ChangeSignatureProcessor.ATTRIBUTE_DEPRECATE);
1706                 if (deprecate != null) {
1707                         changesignatureprocessor.fDelegateDeprecation= Boolean.valueOf(deprecate).booleanValue();
1708                 } else
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();
1713                 } else
1714                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ChangeSignatureProcessor.ATTRIBUTE_DELEGATE));
1715                 return new RefactoringStatus();
1716         }
1717
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);
1724                         else {
1725                                 moveinnertotoprefactoring.fType= (IType) element;
1726                                 moveinnertotoprefactoring.fCodeGenerationSettings= JavaPreferencesSettings.getCodeGenerationSettings(moveinnertotoprefactoring.fType.getJavaProject());
1727                                 try {
1728                                         moveinnertotoprefactoring.initialize();
1729                                 } catch (JavaModelException exception) {
1730                                         JavaPlugin.log(exception);
1731                                 }
1732                         }
1733                 } else
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();
1744                 } else
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();
1749                 } else
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();
1754                 } else
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();
1759                 else
1760                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, MoveInnerToTopRefactoring.ATTRIBUTE_MANDATORY));
1761                 return new RefactoringStatus();
1762         }
1763
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);
1770                         else
1771                                 extractinterfaceprocessor.fSubType= (IType) element;
1772                 } else
1773                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
1774                 final String name= getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);
1775                 if (name != null) {
1776                         extractinterfaceprocessor.fSuperName= name;
1777                         final RefactoringStatus status= extractinterfaceprocessor.checkTypeName(name);
1778                         if (status.hasError())
1779                                 return status;
1780                 } else
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();
1785                 } else
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();
1790                 } else
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();
1795                 } else
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();
1800                 } else
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();
1805                 } else
1806                         return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, SuperTypeRefactoringProcessor.ATTRIBUTE_REPLACE));
1807                 int count= 1;
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));
1815                         else
1816                                 elements.add(element);
1817                         count++;
1818                         attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + count;
1819                 }
1820                 extractinterfaceprocessor.fMembers= elements.toArray(new IMember[elements.size()]);
1821                 extractinterfaceprocessor.fSettings= JavaPreferencesSettings.getCodeGenerationSettings(extractinterfaceprocessor.fSubType.getJavaProject());
1822                 if (!status.isOK())
1823                         return status;
1824                 return new RefactoringStatus();
1825         }
1826 }