Permalink
Browse files

JBIDE-13695 Rename Method Participant does not work correctly if proj…

…ect is out of synch

removed struts
  • Loading branch information...
1 parent be8fe50 commit c5864c4a38af29979efee96c3cb05a1bfbf9538c @dazarov dazarov committed Mar 4, 2013
@@ -1,7 +1,7 @@
CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR=Error
CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED=Error occured during installing CDI facet
CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW=Check Errors View for details
-CDI_RENAME_PROCESSOR_ERROR_OUT_OF_SYNC_PROJECT=Cannot change file(s). Project ''{0}'' is not in sync.
+CDI_RENAME_PROCESSOR_ERROR_OUT_OF_SYNC_PROJECT=Cannot read resource(s). Resource ''{0}'' is not in sync.
CDI_RENAME_PROCESSOR_ERROR_PHANTOM_FILE=Cannot change phantom file: ''{0}''.
CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
CDI_RENAME_PROCESSOR_ERROR_BEAN_NOT_FOUND=CDI Bean Class not found
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -129,8 +130,8 @@ public CDISearcher(IFile declarationFile, String oldName){
}
@Override
- protected void outOfSynch(IProject project) {
- status.addFatalError(NLS.bind(CDICoreMessages.CDI_RENAME_PROCESSOR_ERROR_OUT_OF_SYNC_PROJECT, project.getFullPath().toString()));
+ protected void outOfSynch(IResource resource) {
+ status.addWarning(NLS.bind(CDICoreMessages.CDI_RENAME_PROCESSOR_ERROR_OUT_OF_SYNC_PROJECT, resource.getFullPath().toString()));
}
@Override
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -35,6 +36,7 @@
import org.jboss.tools.common.refactoring.FileChangeFactory;
import org.jboss.tools.common.util.BeanUtil;
import org.jboss.tools.jsf.ui.JsfUIMessages;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jst.web.kb.refactoring.ELProjectSetExtension;
import org.jboss.tools.jst.web.kb.refactoring.IProjectsSet;
import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
@@ -179,14 +181,20 @@ public RenameMethodSearcher(IFile file, String name){
}
@Override
- protected void outOfSynch(IProject project){
- status.addFatalError(NLS.bind(JsfUIMessages.RENAME_METHOD_PARTICIPANT_OUT_OF_SYNC_PROJECT, project.getFullPath().toString()));
+ protected void outOfSynch(IResource resource){
+ //status.addWarning(NLS.bind(JsfUIMessages.RENAME_METHOD_PARTICIPANT_OUT_OF_SYNC_PROJECT, project.getFullPath().toString()));
+ Exception exception= new Exception(NLS.bind(JsfUIMessages.RENAME_METHOD_PARTICIPANT_OUT_OF_SYNC_PROJECT, resource.getFullPath().toString()));
+ exception.setStackTrace(Thread.currentThread().getStackTrace());
+ JsfUiPlugin.getDefault().logError(exception);
}
@Override
protected void match(IFile file, int offset, int length) {
if(isFileReadOnly(file)){
- status.addFatalError(NLS.bind(JsfUIMessages.RENAME_METHOD_PARTICIPANT_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
+ //status.addWarning(NLS.bind(JsfUIMessages.RENAME_METHOD_PARTICIPANT_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
+ Exception exception= new Exception(NLS.bind(JsfUIMessages.RENAME_METHOD_PARTICIPANT_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
+ exception.setStackTrace(Thread.currentThread().getStackTrace());
+ JsfUiPlugin.getDefault().logError(exception);
}else
change(file, offset, length, newName);
}
@@ -12,7 +12,7 @@ JSFManagedPropertyNameAdapter_Rename=Rename...
LinkEditPart_Link=Link
RENAME_METHOD_PARTICIPANT_GETTER_WARNING=Be sure, may be you also should rename setter method to avoid compilation problems.
RENAME_METHOD_PARTICIPANT_SETTER_WARNING=Be sure, may be you also should rename getter method to avoid compilation problems.
-RENAME_METHOD_PARTICIPANT_OUT_OF_SYNC_PROJECT=Cannot change file(s). Project ''{0}'' is not in sync.
+RENAME_METHOD_PARTICIPANT_OUT_OF_SYNC_PROJECT=Cannot read resource(s). Resource ''{0}'' is not in sync.
RENAME_METHOD_PARTICIPANT_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES=Update method references in EL
RENAME_METHOD_PARTICIPANT_QUESTION_DIALOG_TITLE=Read-only File Encountered
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.ltk.core.refactoring.CompositeChange;
@@ -156,8 +157,8 @@ protected void match(IFile file, int offset, int length) {
}
@Override
- protected void outOfSynch(IProject project) {
- status.addFatalError(NLS.bind(ElCoreMessages.EL_RENAME_PROCESSOR_OUT_OF_SYNC_PROJECT, project.getFullPath().toString()));
+ protected void outOfSynch(IResource resource) {
+ status.addWarning(NLS.bind(ElCoreMessages.EL_RENAME_PROCESSOR_OUT_OF_SYNC_PROJECT, resource.getFullPath().toString()));
}
protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
@@ -32,7 +32,7 @@ RENAME_SEAM_COMPONENT_PROCESSOR_THIS_IS_NOT_A_SEAM_COMPONENT=This is not a Seam
RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE=Rename Seam Context Variable
RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_CAN_NOT_FIND_CONTEXT_VARIABLE=Can not find Seam Context Variable: ''{0}''.
SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR=Component ''{0}'' has a declaration which is located in jar file: ''{1}''. Press next to force rename.
-SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_PROJECT=Cannot change file(s). Project ''{0}'' is not in sync.
+SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_PROJECT=Cannot read resource(s). Resource ''{0}'' is not in sync.
SEAM_RENAME_PROCESSOR_LOCATION_NOT_FOUND=Location for declaration or annotation not found in file: ''{0}''
SEAM_RENAME_PROCESSOR_DECLARATION_NOT_FOUND=Component: ''{0}'' does not have any declarations
SEAM_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
@@ -16,10 +16,10 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaElement;
import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
import org.jboss.tools.common.el.core.resolver.ELResolution;
import org.jboss.tools.common.el.core.resolver.ELResolver;
import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
@@ -67,7 +67,7 @@ else if(project.equals(projectsSet.getEarProject()))
}
@Override
- protected void outOfSynch(IProject file){
+ protected void outOfSynch(IResource resource){
// do nothing
}
@@ -475,8 +475,8 @@ public boolean isRelevant(String content) {
}
@Override
- protected void outOfSynch(IProject project) {
- status.addFatalError(NLS.bind(SeamCoreMessages.SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_PROJECT, project.getFullPath().toString()));
+ protected void outOfSynch(IResource resource) {
+ status.addWarning(NLS.bind(SeamCoreMessages.SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_PROJECT, resource.getFullPath().toString()));
}
@Override

0 comments on commit c5864c4

Please sign in to comment.