Author: scabanovich
Date: 2010-12-28 12:06:16 -0500 (Tue, 28 Dec 2010)
New Revision: 27772
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldParticipant.java
Log:
JBIDE-8011
https://issues.jboss.org/browse/JBIDE-8011
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldParticipant.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldParticipant.java 2010-12-28
17:04:36 UTC (rev 27771)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/JSFRenameFieldParticipant.java 2010-12-28
17:06:16 UTC (rev 27772)
@@ -20,6 +20,7 @@
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.common.model.refactoring.RenameModelObjectChange;
import org.jboss.tools.common.model.refactoring.RenameProcessorRunner;
+import org.jboss.tools.common.util.BeanUtil;
public class JSFRenameFieldParticipant extends RenameParticipant implements
ISharableParticipant {
public static final String PARTICIPANT_NAME="jsf-RenameFieldParticipant";
//$NON-NLS-1$
@@ -80,10 +81,9 @@
XModel model = JSFRenameFieldChange.getModel(method);
if(model == null) return null;
XModelObject[] os = JSFRenameFieldHelper.getBeanList(model, method);
- String name = method.getElementName();
- if(!name.startsWith("get") && !name.startsWith("set"))
return null;
- name = name.substring(3, 4).toLowerCase() + name.substring(4);
- os = getProperties(os, name);
+ String propertyName = BeanUtil.getPropertyName(method.getElementName());
+ if(propertyName == null) return null;
+ os = getProperties(os, propertyName);
RenameModelObjectChange c1 = RenameModelObjectChange.createChange(os, newName,
"property-name"); //$NON-NLS-1$
return c1;
} else if(object != null) {