[jbosstools-commits] JBoss Tools SVN: r17609 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Sep 16 06:46:37 EDT 2009


Author: dazarov
Date: 2009-09-16 06:46:37 -0400 (Wed, 16 Sep 2009)
New Revision: 17609

Modified:
   trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
   trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4856

Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java	2009-09-16 07:55:52 UTC (rev 17608)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java	2009-09-16 10:46:37 UTC (rev 17609)
@@ -337,4 +337,10 @@
 		
 		return methodName;
 	}
+	
+	public static boolean isSetter(String methodName){
+		if(methodName.startsWith(SET))
+			return true;
+		return false;
+	}
 }

Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java	2009-09-16 07:55:52 UTC (rev 17608)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java	2009-09-16 10:46:37 UTC (rev 17609)
@@ -47,7 +47,8 @@
 	@Override
 	public RefactoringStatus checkConditions(IProgressMonitor pm,
 			CheckConditionsContext context) throws OperationCanceledException {
-		searcher.findELReferences();
+		if(searcher != null)
+			searcher.findELReferences();
 		
 		return status;
 	}
@@ -71,7 +72,11 @@
 			rootChange = new CompositeChange("");
 			method = (IMethod)element;
 			
+			if(!SeamRenameMethodSearcher.isSetter(method.getElementName()))
+				return false;
+			
 			oldName = SeamRenameMethodSearcher.getPropertyName(method.getElementName());
+			
 			newName = SeamRenameMethodSearcher.getPropertyName(getArguments().getNewName());
 			searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
 			return true;
@@ -104,7 +109,7 @@
 		if(!keys.contains(key)){
 			TextFileChange change = getChange(file);
 			TextEdit edit = new ReplaceEdit(offset, length, text);
-			//change.addEdit(edit);
+			change.addEdit(edit);
 			keys.add(key);
 		}
 	}



More information about the jbosstools-commits mailing list