]> source.dussan.org Git - aspectj.git/commitdiff
231396: refactoring: Moved CharOperation and NameConvertor
authoraclement <aclement>
Mon, 12 May 2008 18:00:23 +0000 (18:00 +0000)
committeraclement <aclement>
Mon, 12 May 2008 18:00:23 +0000 (18:00 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java

index 85fc2b4fff1195ce1ed9e55cd58c0482c81e3144..9ca8b00ff1feb59fda5e0cc4ec15dbc5e79dfb4b 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
 import org.aspectj.ajdt.internal.compiler.ast.ValidateAtAspectJAnnotationsVisitor;
 import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
 import org.aspectj.ajdt.internal.core.builder.AjState;
+import org.aspectj.asm.internal.CharOperation;
 import org.aspectj.bridge.IMessage;
 import org.aspectj.bridge.IMessageHandler;
 import org.aspectj.bridge.IProgressListener;
@@ -36,7 +37,6 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
 import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
 import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
-import org.aspectj.util.CharOperation;
 import org.aspectj.weaver.bcel.BcelWeaver;
 import org.aspectj.weaver.bcel.BcelWorld;
 import org.aspectj.weaver.patterns.CflowPointcut;
@@ -443,7 +443,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
        
        /** Return true if we've decided to drop back to a full build (too much has changed) */
        private boolean weaveQueuedEntries() throws IOException {
-               if (debugPipeline)System.err.println(">.weaveQueuedEntries()");
+               if (debugPipeline) System.err.println(">.weaveQueuedEntries()");
                for (Iterator iter = resultsPendingWeave.iterator(); iter.hasNext();) {
                        InterimCompilationResult iresult = (InterimCompilationResult) iter.next();
                        for (int i = 0; i < iresult.unwovenClassFiles().length; i++) {
index de0ee5a9042b6c9432e897f96c1efea50f1f3d9f..3522848d9f19426733d9d624e3adfda1fd89978d 100644 (file)
@@ -998,27 +998,6 @@ public class AjState {
                recordFQNsResultingFromCompilationUnit(sourceFile,result);
        }
 
-       /**
-        * Currently unused, if we ditch classesFromName, we might need this.... (in noteResult)
-        * @param file
-        * @return
-        */
-       private UnwovenClassFile maybeGetExistingClassFileFor(UnwovenClassFile classFile) {
-               File existing = new File(classFile.getFilename());
-               if (!existing.exists()) {
-                       return null;
-               } 
-               else {
-                       try {
-                               return new UnwovenClassFile(classFile.getFilename(),FileUtil.readAsByteArray(existing));
-                       } 
-                       catch (IOException ex) {
-                               throw new IllegalStateException("Unable to read contents of '" + classFile.getFilename() + "' " +
-                                               "from last compile cycle");
-                       }
-               }
-       }
-
        /**
         * @param sourceFile
         * @param unwovenClassFiles
index 4cf4d5e8e56fc52ce078aa404ab7b2733f03e721..4385e2a99cc9707355afeac6c2cf6b2967db4927 100644 (file)
@@ -35,6 +35,7 @@ import org.aspectj.asm.AsmManager;
 import org.aspectj.asm.IHierarchy;
 import org.aspectj.asm.IProgramElement;
 import org.aspectj.asm.IRelationship;
+import org.aspectj.asm.internal.CharOperation;
 import org.aspectj.asm.internal.ProgramElement;
 import org.aspectj.bridge.ISourceLocation;
 import org.aspectj.bridge.SourceLocation;
@@ -58,7 +59,6 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
 import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
-import org.aspectj.util.CharOperation;
 import org.aspectj.util.LangUtil;
 import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.Member;
@@ -285,12 +285,12 @@ public class AsmHierarchyBuilder extends ASTVisitor {
        public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) {
                String name = new String(memberTypeDeclaration.name);
                
-        // OPTIMIZE dont call kind 3 times
                IProgramElement.Kind kind = IProgramElement.Kind.CLASS;
+               int typeDeclarationKind = TypeDeclaration.kind(memberTypeDeclaration.modifiers);
                if (memberTypeDeclaration instanceof AspectDeclaration) kind = IProgramElement.Kind.ASPECT;
-               else if (TypeDeclaration.kind(memberTypeDeclaration.modifiers) == TypeDeclaration.INTERFACE_DECL) kind = IProgramElement.Kind.INTERFACE;
-               else if (TypeDeclaration.kind(memberTypeDeclaration.modifiers)  == TypeDeclaration.ENUM_DECL) kind = IProgramElement.Kind.ENUM;
-               else if (TypeDeclaration.kind(memberTypeDeclaration.modifiers)  == TypeDeclaration.ANNOTATION_TYPE_DECL) kind = IProgramElement.Kind.ANNOTATION;
+               else if (typeDeclarationKind == TypeDeclaration.INTERFACE_DECL) kind = IProgramElement.Kind.INTERFACE;
+               else if (typeDeclarationKind == TypeDeclaration.ENUM_DECL) kind = IProgramElement.Kind.ENUM;
+               else if (typeDeclarationKind == TypeDeclaration.ANNOTATION_TYPE_DECL) kind = IProgramElement.Kind.ANNOTATION;
 
         //@AJ support
         if (memberTypeDeclaration.annotations != null) {