Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameMethodProcessor.java

Issue 10582003: Issue 1355. Support for call(). Tweaks for element locator and rename refactoring (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Check target range Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 23 matching lines...) Expand all
34 * @param method the {@link Method} to rename, not <code>null</code>. 34 * @param method the {@link Method} to rename, not <code>null</code>.
35 */ 35 */
36 public RenameMethodProcessor(Method method) { 36 public RenameMethodProcessor(Method method) {
37 super(method); 37 super(method);
38 } 38 }
39 39
40 @Override 40 @Override
41 public RefactoringStatus checkNewElementName(String newName) throws CoreExcept ion { 41 public RefactoringStatus checkNewElementName(String newName) throws CoreExcept ion {
42 RefactoringStatus result = Checks.checkMethodName(newName); 42 RefactoringStatus result = Checks.checkMethodName(newName);
43 result.merge(super.checkNewElementName(newName)); 43 result.merge(super.checkNewElementName(newName));
44 // method "call()" cannot be renamed
45 if (getCurrentElementName().equals("call")) {
46 result.addFatalError(RefactoringCoreMessages.RenameMethodProcessor_isCall) ;
47 }
48 // done
44 return result; 49 return result;
45 } 50 }
46 51
47 @Override 52 @Override
48 public String getIdentifier() { 53 public String getIdentifier() {
49 return IDENTIFIER; 54 return IDENTIFIER;
50 } 55 }
51 56
52 @Override 57 @Override
53 public Object getNewElement() { 58 public Object getNewElement() {
54 return member.getDeclaringType().getMethod(getNewElementName(), null); 59 return member.getDeclaringType().getMethod(getNewElementName(), null);
55 } 60 }
56 61
57 @Override 62 @Override
58 public String getProcessorName() { 63 public String getProcessorName() {
59 return RefactoringCoreMessages.RenameMethodProcessor_name; 64 return RefactoringCoreMessages.RenameMethodProcessor_name;
60 } 65 }
61 66
62 @Override 67 @Override
63 public boolean isApplicable() throws CoreException { 68 public boolean isApplicable() throws CoreException {
64 return RefactoringAvailabilityTester.isRenameAvailable((Method) member); 69 return RefactoringAvailabilityTester.isRenameAvailable((Method) member);
65 } 70 }
66 71
67 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698