Author: dazarov
Date: 2009-12-08 09:28:41 -0500 (Tue, 08 Dec 2009)
New Revision: 19107
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
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-5401
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-12-08
14:26:21 UTC (rev 19106)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-12-08
14:28:41 UTC (rev 19107)
@@ -58,6 +58,9 @@
if(component != null){
checkDeclarations(component);
+ if(status.hasFatalError())
+ return status;
+
rootChange = new
CompositeChange(SeamCoreMessages.RENAME_SEAM_COMPONENT_PROCESSOR_TITLE);
renameComponent(pm, component);
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-12-08
14:26:21 UTC (rev 19106)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-12-08
14:28:41 UTC (rev 19107)
@@ -65,6 +65,9 @@
if(component != null){
checkDeclarations(component);
+ if(status.hasFatalError())
+ return status;
+
renameComponent(pm, component);
}else{
renameSeamContextVariable(pm, file);
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-12-08
14:26:21 UTC (rev 19106)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-12-08
14:28:41 UTC (rev 19107)
@@ -304,19 +304,19 @@
protected void checkDeclarations(ISeamComponent component) throws CoreException{
if(component.getJavaDeclaration() != null){
- if(SeamUtil.isJar(component.getJavaDeclaration()) &&
component.getJavaDeclaration().getName() != null)
+ if(component.getJavaDeclaration().getResource() == null)
+ status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_BROKEN_DECLARATION,
new String[]{component.getName()}));
+ else if(SeamUtil.isJar(component.getJavaDeclaration()) &&
component.getJavaDeclaration().getName() != null)
status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR,
new String[]{component.getName(),
component.getJavaDeclaration().getResource().getFullPath().toString()}));
- else if(component.getJavaDeclaration().getResource() == null)
- status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_BROKEN_DECLARATION,
new String[]{component.getName()}));
}
Set<ISeamXmlComponentDeclaration> xmlDecls = component.getXmlDeclarations();
for(ISeamXmlComponentDeclaration xmlDecl : xmlDecls){
- if(SeamUtil.isJar(xmlDecl) && xmlDecl.getName() != null)
+ if(xmlDecl.getResource() == null)
+ status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_BROKEN_DECLARATION,
new String[]{component.getName()}));
+ else if(SeamUtil.isJar(xmlDecl) && xmlDecl.getName() != null)
status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR,
new String[]{component.getName(), xmlDecl.getResource().getFullPath().toString()}));
- else if(xmlDecl.getResource() == null)
- status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_BROKEN_DECLARATION,
new String[]{component.getName()}));
}
}