dr Extractors { public abstract class AJDTExtractor { protected abstract void writeAspect() throws CoreException; } public abstract privileged aspect AspectExtractor { pointcut writeAspect(): execution(* AJDTExtractor+.writeAspect(..)); } public abstract privileged aspect AspectCallExtractor extends AspectExtractor { abstract pointcut callExtractor(); pointcut returnMethodInvocation(ASTNode statementBeforeSelection): call(* AJDTExtractor+.acquireMethodInvocation(ASTNode)) && args(statementBeforeSelection); pointcut addNodesForImport(AJDTExtractor obj,TypeDeclaration typeDeclaration,MethodDeclaration methodDeclaration,MethodInvocation methodInvocation): execution(* AJDTExtractor+.addCurrentClassAndMethodReturnAndParametersTypesToNodesForImport(TypeDeclaration,MethodDeclaration,MethodInvocation)) && args(typeDeclaration, methodDeclaration, methodInvocation) && this(obj); pointcut prepareStatements(AJDTExtractor obj): writeAspect() && this(obj) && callExtractor(); pointcut createAdviceStrings(AJDTExtractor obj): call(* AJDTExtractor+.*ReturnAndParametersTypesToNodesForImport(..)) && target(obj); } public abstract privileged aspect AspectParentExtractor extends AspectExtractor{ abstract pointcut genDecParents(); pointcut updateAspectString(AJDTExtractor obj): genDecParents() && this(obj) && cflowbelow(writeAspect()); } } dr Validators{ public abstract class Validator implements IValidator { public abstract ValidatorStatus validateOrigin( RefactoringInfo refactoringInfo); } public interface IBlockVisitor {} public abstract privileged aspect AspectContainerBlockVisitor { public ValidatorStatus adviceBlockVisitor(RefactoringInfo refactoringInfo, ValidatorStatus validatorStatus, LinkedList selectedNodes, String[]messages); } public abstract privileged aspect AspectValidator { abstract pointcut validateOrigin(RefactoringInfo refactoringInfo, ValidatorStatus validatorStatus, LinkedList selectedNodes, String[] msgs); } public abstract privileged aspect AspectCallValidator extends AspectValidator{ protected ValidatorStatus methodCallValidateOrigin(RefactoringInfo refactoringInfo, ValidatorStatus validatorStatus, LinkedList selectedNodes, String[] msgs); } //codigo abaixo devera ser definido para cada validador especifico public class AfterCallValidator extends Validator { public ValidatorStatus validateOriginWrap(RefactoringInfo refactoringInfo, ValidatorStatus validatorStatus, LinkedList selectedNodes, String[] msgs); } public privileged aspect AspectAfterCallValidator extends AspectCallValidator { declare parents: AfterCallValidator implements IBlockVisitor; pointcut validateOrigin(RefactoringInfo refactoringInfo, ValidatorStatus validatorStatus, LinkedList selectedNodes, String[] msgs): call(public ValidatorStatus AfterCallValidator.validateOriginWrap(RefactoringInfo, ValidatorStatus,LinkedList, String[])) && args(refactoringInfo, validatorStatus,selectedNodes,msgs); } } dr ExceptionHandler { public abstract aspect AspectException { protected abstract pointcut objectCoreException(); protected abstract pointcut voidCoreException(); protected abstract pointcut voidSoftenException(); protected abstract pointcut voidIOException(); protected abstract boolean verifySoftenException(Throwable exception); Object around() throws CoreException : objectCoreException(); void around() throws CoreException : voidSoftenException(); void around() throws CoreException : voidIOException(); void around() throws CoreException : voidCoreException(); } public org.cesar.flip.flipg.pv.PureVariantsAdapter { CoreException exceptions originated from calls of IModelManager or IPVModel methods must be throwed (and not handled) private void loadFeatureModel(String featureModelPath) throws CoreException { .. MalformedURLException exception originated inside this method should not be handled. .. } private void loadconfigurationKnowledge(String familyModelPath) throws CoreException { .. MalformedURLException exception originated inside this method should not be handled. .. } private void copyFileFromPluginToNewProject(String filePath, IProject destination) throws CoreException { .. IOException exceptions originated inside this method should not be handled. .. } } public org.cesar.flip.flipc.flipc.BuildExecution { CoreException exceptions originated from calls of IModelManager or IPVModel methods must be throwed (and not handled) public void transformAllModels(IProject project, List modelDescriptorsPaths, IPath outputPath, IProgressMonitor monitor) throws CoreException { .. MalformedURLException exception originated inside this method should not be handled. .. } } public aspect PureVariantsAdapterAspect extends AspectException { pointcut callImodelManagerReturn(): call(Object+ IModelManager.*(..) throws CoreException);// && pointcut callImodelManagerVoid(): call(void IModelManager.*(..) throws CoreException);// && pointcut callIPVModellUpdate(): call(* IPVModel.update(..)); pointcut getMalformedUrlException(): execution(void PureVariantsAdapter.loadFeatureModel(..)) || execution(void PureVariantsAdapter.loadconfigurationKnowledge(..)) || execution(void BuildExecution.transformAllModels(..)); pointcut callCopyFileFromPluginToNewProject(): execution(void PureVariantsAdapter.copyFileFromPluginToNewProject(..)); pointcut ioexception(): (call(* *.*(..) throws IOException) || call(*.new(..) throws FileNotFoundException)); pointcut callNewUrl(): call(URL.new(..)); declare soft : MalformedURLException: callNewUrl(); declare soft : IOException: ioexception(); protected boolean verifySoftenException(Throwable exception) { return exception instanceof MalformedURLException; } protected pointcut objectCoreException() : callImodelManagerReturn() || callIPVModellUpdate(); protected pointcut voidSoftenException() : getMalformedUrlException(); protected pointcut voidCoreException(): callImodelManagerVoid(); protected pointcut voidIOException(): callCopyFileFromPluginToNewProject(); } public org.cesar.flip.flipex.preprocessed.extractors.PreprocessedExtractors { CoreException exceptions originated from calls of IModelManager or IPVModel methods must be throwed (and not handled) public void extract() throws CoreException { .. IOException exceptions originated inside this method should not be handled. .. } private void write(IPath filePath, TextEdit changes) throws CoreException { .. BadLocationException exceptions originated inside this method should not be handled. .. } } public aspect AspectPreprocessedExtractor extends AspectException { private boolean extraBehaviour = false; private HashMap exceptionConstantsHashMap; private HashMap pvAdapterMessagesHashMap; pointcut callThrowsCoreExceptionObject(): call(Object+ *.*(..) throws CoreException); pointcut callMethodsInsideExtract(): (call(void IResource.*(..) throws CoreException) || call(void *.writeJava(..) throws CoreException)) && withincode(void PreprocessedExtractor.extract(..)); pointcut callIFileBuffer(): call(void IFileBuffer.*(..) throws CoreException) || call(void IFileBufferManager.*(..) throws CoreException); pointcut executionWrite(): execution(void PreprocessedExtractor.write(..)); pointcut ioexception(): call(void *.insertNewPreprocessedCode(..)); protected pointcut objectCoreException(); declare soft: IOException: ioexception(); protected pointcut voidCoreException(): callIFileBuffer() || callMethodsInsideExtract(); protected pointcut voidSoftenException(): executionWrite(); protected pointcut voidIOException(): execution(void *.extract(..)); pointcut callApply(): call(* TextEdit.apply(..)); declare soft: BadLocationException: callApply(); protected boolean verifySoftenException(Throwable exception) { if (exception instanceof BadLocationException) { return true; } return false;