Author: dazarov
Date: 2009-06-30 04:57:31 -0400 (Tue, 30 Jun 2009)
New Revision: 16276
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-30
08:36:59 UTC (rev 16275)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-30
08:57:31 UTC (rev 16276)
@@ -185,7 +185,8 @@
private boolean checkFactories(ISeamProject seamProject){
if (seamProject != null) {
- return seamProject.getFactoriesByName(getOldName()) != null;
+ Set<ISeamFactory> factories = seamProject.getFactoriesByName(getOldName());
+ return factories.size() > 0;
}
return false;
}
@@ -194,7 +195,7 @@
if (seamProject != null) {
Set<IBijectedAttribute> variables =
seamProject.getBijectedAttributesByName(getOldName(), BijectedAttributeType.OUT);
- return variables != null;
+ return variables.size() > 0;
}
return false;
}
@@ -203,7 +204,7 @@
if (seamProject != null) {
Set<IBijectedAttribute> variables =
seamProject.getBijectedAttributesByName(getOldName(), BijectedAttributeType.DATA_BINDER);
- return variables != null;
+ return variables.size() > 0;
}
return false;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-06-30
08:36:59 UTC (rev 16275)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-06-30
08:57:31 UTC (rev 16276)
@@ -192,12 +192,12 @@
}
private void findAnnotations(ISeamProject seamProject, BijectedAttributeType type,
String locationPath){
- Set<IBijectedAttribute> inSet =
seamProject.getBijectedAttributesByName(getOldName(), type);
+ Set<IBijectedAttribute> attributes =
seamProject.getBijectedAttributesByName(getOldName(), type);
- for(IBijectedAttribute inAtt : inSet){
- ITextSourceReference location = inAtt.getLocationFor(locationPath);
+ for(IBijectedAttribute attribute : attributes){
+ ITextSourceReference location = attribute.getLocationFor(locationPath);
if(location != null)
- changeAnnotation(location, (IFile)inAtt.getResource());
+ changeAnnotation(location, (IFile)attribute.getResource());
}
}
@@ -681,8 +681,8 @@
for (IProject project : projects) {
ISeamProject sProject = SeamCorePlugin.getSeamProject(project, true);
if(sProject != null){
- findAnnotations(sProject, BijectedAttributeType.OUT,
SeamAnnotations.OUT_ANNOTATION_TYPE);
- findAnnotations(sProject, BijectedAttributeType.DATA_BINDER,
"name"/*SeamAnnotations.DATA_MODEL_ANNOTATION_TYPE*/);
+ findAnnotations(sProject, BijectedAttributeType.OUT,
ISeamXmlComponentDeclaration.NAME/*SeamAnnotations.OUT_ANNOTATION_TYPE*/);
+ findAnnotations(sProject, BijectedAttributeType.DATA_BINDER,
ISeamXmlComponentDeclaration.NAME/*SeamAnnotations.DATA_MODEL_ANNOTATION_TYPE*/);
findFactories(sProject);
}
}