/** Message String for any AbortException thrown from ICommand API's */
public static final String ABORT_MESSAGE = "ABORT";
- private boolean canRepeatCommand = true;
+// private boolean canRepeatCommand = true;
AjBuildManager buildManager = null;
String[] savedArgs = null;
package org.aspectj.ajdt.internal.compiler.ast;
-import java.util.Arrays;
+//import java.util.Arrays;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.InlineAccessFieldBinding;
}
- ResolvedMember m = world.makeResolvedMember(binding);
+ ResolvedMember m = EclipseFactory.makeResolvedMember(binding);
if (inAspect.accessForInline.containsKey(m)) return (MethodBinding)inAspect.accessForInline.get(m);
MethodBinding ret = world.makeMethodBinding(
AjcMemberMaker.inlineAccessMethodForMethod(inAspect.typeX, m)
}
private MethodBinding getSuperAccessMethod(MethodBinding binding) {
- ResolvedMember m = world.makeResolvedMember(binding);
+ ResolvedMember m = EclipseFactory.makeResolvedMember(binding);
ResolvedMember superAccessMember = AjcMemberMaker.superAccessMethod(inAspect.typeX, m);
if (inAspect.superAccessForInline.containsKey(superAccessMember)) {
return ((SuperAccessMethodPair)inAspect.superAccessForInline.get(superAccessMember)).accessMethod;
if (kind == AdviceKind.Around) {
int n = proceedCalls.size();
- EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(upperScope);
+// EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(upperScope);
//System.err.println("access to: " + Arrays.asList(handler.getMembers()));
codeStream.invokestatic(world.makeMethodBindingForCall(
AjcMemberMaker.ajcPreClinitMethod(
- world.fromBinding(classScope.referenceContext.binding)
+ EclipseFactory.fromBinding(classScope.referenceContext.binding)
)));
}
super.generateSyntheticCode(classScope, codeStream);
codeStream.invokestatic(world.makeMethodBindingForCall(
AjcMemberMaker.ajcPostClinitMethod(
- world.fromBinding(classScope.referenceContext.binding)
+ EclipseFactory.fromBinding(classScope.referenceContext.binding)
)));
}
import org.aspectj.weaver.patterns.*;
import org.eclipse.jdt.internal.compiler.ClassFile;
import org.eclipse.jdt.internal.compiler.CompilationResult;
-import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
+//import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Clinit;
-import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
+//import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.codegen.Label;
import org.eclipse.jdt.internal.compiler.lookup.*;
-import org.eclipse.jdt.internal.compiler.parser.Parser;
+//import org.eclipse.jdt.internal.compiler.parser.Parser;
// (we used to...) making all aspects member types avoids a nasty hierarchy pain
}
private void generateMethod(ClassFile classFile, MethodBinding methodBinding, BodyGenerator gen) {
- EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
+// EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
classFile.generateMethodInfoHeader(methodBinding);
int methodAttributeOffset = classFile.contentsOffset;
int attributeNumber = classFile.generateMethodInfoAttribute(methodBinding, AstUtil.getAjSyntheticAttribute());
{
final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
generateMethod(classFile, world.makeMethodBinding(AjcMemberMaker.perCflowPush(
- world.fromBinding(binding))),
+ EclipseFactory.fromBinding(binding))),
new BodyGenerator() {
public void generate(CodeStream codeStream) {
// body starts here
{
final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
generateMethod(classFile, world.makeMethodBinding(AjcMemberMaker.ajcPreClinitMethod(
- world.fromBinding(binding))),
+ EclipseFactory.fromBinding(binding))),
new BodyGenerator() {
public void generate(CodeStream codeStream) {
// body starts here
final TypeBinding interfaceType)
{
final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
- generateMethod(classFile, AjcMemberMaker.perObjectBind(world.fromBinding(binding)),
+ generateMethod(classFile, AjcMemberMaker.perObjectBind(EclipseFactory.fromBinding(binding)),
new BodyGenerator() {
public void generate(CodeStream codeStream) {
// body starts here
{
final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
generateMethod(classFile, world.makeMethodBinding(AjcMemberMaker.ajcPostClinitMethod(
- world.fromBinding(binding))),
+ EclipseFactory.fromBinding(binding))),
new BodyGenerator() {
public void generate(CodeStream codeStream) {
// body starts here
package org.aspectj.ajdt.internal.compiler.ast;
-import java.util.List;
+//import java.util.List;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseScope;
import org.aspectj.weaver.AjAttribute;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
-import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
+//import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.eclipse.jdt.internal.compiler.parser.Parser;
public class IfMethodDeclaration extends MethodDeclaration {
pre.binding = world.makeMethodBinding(
AjcMemberMaker.preIntroducedConstructor(aspectTypeX, targetTypeX,
- world.fromBindings(binding.parameters)));
+ EclipseFactory.fromBindings(binding.parameters)));
pre.bindArguments();
pre.bindThrownExceptions();
Expression arg = explicitConstructorCall.arguments[i];
ResolvedMember conversionMethod =
- AjcMemberMaker.toObjectConversionMethod(world.fromBinding(explicitConstructorCall.binding.parameters[i]));
+ AjcMemberMaker.toObjectConversionMethod(EclipseFactory.fromBinding(explicitConstructorCall.binding.parameters[i]));
if (conversionMethod != null) {
arg = new KnownMessageSend(world.makeMethodBindingForCall(conversionMethod),
new CastExpression(new NullLiteral(0, 0),
LocalVariableBinding binding = pre.arguments[i].binding;
Expression arg = AstUtil.makeResolvedLocalVariableReference(binding);
ResolvedMember conversionMethod =
- AjcMemberMaker.toObjectConversionMethod(world.fromBinding(binding.type));
+ AjcMemberMaker.toObjectConversionMethod(EclipseFactory.fromBinding(binding.type));
if (conversionMethod != null) {
arg = new KnownMessageSend(world.makeMethodBindingForCall(conversionMethod),
new CastExpression(new NullLiteral(0, 0),
ResolvedTypeX declaringTypeX = world.fromEclipse(onTypeBinding);
ResolvedTypeX aspectType = world.fromEclipse(classScope.referenceContext.binding);
- ResolvedMember bindingAsMember = world.makeResolvedMember(binding);
+ ResolvedMember bindingAsMember = EclipseFactory.makeResolvedMember(binding);
ResolvedMember signature =
new ResolvedMember(Member.CONSTRUCTOR, declaringTypeX, declaredModifiers,
((NewConstructorTypeMunger)munger).setExplicitConstructor(
- world.makeResolvedMember(explicitConstructor));
+ EclipseFactory.makeResolvedMember(explicitConstructor));
} else {
((NewConstructorTypeMunger)munger).setExplicitConstructor(
new ResolvedMember(Member.CONSTRUCTOR,
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
-import org.eclipse.jdt.internal.compiler.flow.FlowContext;
+//import org.eclipse.jdt.internal.compiler.flow.FlowContext;
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext;
import org.eclipse.jdt.internal.compiler.lookup.*;
else
resolvedPosition++;
}
- TypeBinding type;
+// TypeBinding type;
if (methodBinding.isStatic())
codeStream.invokestatic(methodBinding);
else {
import org.aspectj.ajdt.internal.core.builder.EclipseSourceContext;
import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.ResolvedPointcutDefinition;
-import org.aspectj.weaver.ResolvedTypeX;
-import org.aspectj.weaver.TypeX;
+//import org.aspectj.weaver.ResolvedTypeX;
+//import org.aspectj.weaver.TypeX;
import org.aspectj.weaver.patterns.Pointcut;
import org.eclipse.jdt.internal.compiler.ClassFile;
import org.eclipse.jdt.internal.compiler.CompilationResult;
}
private void removeParameter(int indexToRemove) {
- TypeBinding[] parameters = method.binding.parameters;
+// TypeBinding[] parameters = method.binding.parameters;
method.scope.locals = removeLocalBinding(indexToRemove, method.scope.locals);
method.binding.parameters = removeParameter(indexToRemove, method.binding.parameters);
}
}
private void removeParameter(int indexToRemove) {
- TypeBinding[] parameters = method.binding.parameters;
+// TypeBinding[] parameters = method.binding.parameters;
method.scope.locals = removeLocalBinding(indexToRemove, method.scope.locals);
method.scope.localIndex -= 1;
method.binding.parameters = removeParameter(indexToRemove, method.binding.parameters);
import java.util.*;
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
-import org.aspectj.ajdt.internal.compiler.ast.DeclareDeclaration;
+//import org.aspectj.ajdt.internal.compiler.ast.DeclareDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
-import org.aspectj.asm.*;
-import org.aspectj.asm.IProgramElement;
-import org.aspectj.asm.internal.Relationship;
+//import org.aspectj.asm.*;
+//import org.aspectj.asm.IProgramElement;
+//import org.aspectj.asm.internal.Relationship;
import org.aspectj.bridge.IMessage;
import org.aspectj.weaver.*;
import org.aspectj.weaver.patterns.*;
package org.aspectj.ajdt.internal.compiler.lookup;
-import java.io.IOException;
+//import java.io.IOException;
import org.aspectj.asm.*;
import org.aspectj.asm.internal.ProgramElement;
ResolvedTypeX onType,
EclipseTypeMunger munger) {
- IProgramElement.Kind kind = IProgramElement.Kind.ERROR;
- if (munger.getMunger().getKind() == ResolvedTypeMunger.Field) {
- kind = IProgramElement.Kind.INTER_TYPE_FIELD;
- } else if (munger.getMunger().getKind() == ResolvedTypeMunger.Constructor) {
- kind = IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR;
- } else if (munger.getMunger().getKind() == ResolvedTypeMunger.Method) {
- kind = IProgramElement.Kind.INTER_TYPE_METHOD;
- } else if (munger.getMunger().getKind() == ResolvedTypeMunger.Parent) {
- kind = IProgramElement.Kind.INTER_TYPE_PARENT;
- }
+// IProgramElement.Kind kind = IProgramElement.Kind.ERROR;
+// if (munger.getMunger().getKind() == ResolvedTypeMunger.Field) {
+// kind = IProgramElement.Kind.INTER_TYPE_FIELD;
+// } else if (munger.getMunger().getKind() == ResolvedTypeMunger.Constructor) {
+// kind = IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR;
+// } else if (munger.getMunger().getKind() == ResolvedTypeMunger.Method) {
+// kind = IProgramElement.Kind.INTER_TYPE_METHOD;
+// } else if (munger.getMunger().getKind() == ResolvedTypeMunger.Parent) {
+// kind = IProgramElement.Kind.INTER_TYPE_PARENT;
+// }
if (munger.getSourceLocation() != null
&& munger.getSourceLocation() != null) {
private Map/*TypeX, TypeBinding*/ typexToBinding = new HashMap();
//XXX currently unused
- private Map/*TypeBinding, ResolvedTypeX*/ bindingToResolvedTypeX = new HashMap();
+// private Map/*TypeBinding, ResolvedTypeX*/ bindingToResolvedTypeX = new HashMap();
public static EclipseFactory fromLookupEnvironment(LookupEnvironment env) {
AjLookupEnvironment aenv = (AjLookupEnvironment)env;
//System.err.println("binding: " + b);
// Binding(tokens, bits & RestrictiveFlagMASK, this)
- return world.fromBinding(b);
+ return EclipseFactory.fromBinding(b);
/*
computeImports();
}
- private ResolvedTypeX resolveVisible(String name) {
- ResolvedTypeX found = world.getWorld().resolve(TypeX.forName(name), true);
- if (found == ResolvedTypeX.MISSING) return found;
- if (ResolvedTypeX.isVisible(found.getModifiers(), found, enclosingType)) return found;
- return ResolvedTypeX.MISSING;
- }
+// private ResolvedTypeX resolveVisible(String name) {
+// ResolvedTypeX found = world.getWorld().resolve(TypeX.forName(name), true);
+// if (found == ResolvedTypeX.MISSING) return found;
+// if (ResolvedTypeX.isVisible(found.getModifiers(), found, enclosingType)) return found;
+// return ResolvedTypeX.MISSING;
+// }
// public TypeX lookupType(String name, IHasPosition location) {
public TypeX getEnclosingType() {
if (context instanceof TypeDeclaration) {
- return world.fromBinding(((TypeDeclaration)context).binding);
+ return EclipseFactory.fromBinding(((TypeDeclaration)context).binding);
} else if (context instanceof AbstractMethodDeclaration) {
- return world.fromBinding(((AbstractMethodDeclaration)context).binding.declaringClass);
+ return EclipseFactory.fromBinding(((AbstractMethodDeclaration)context).binding.declaringClass);
} else {
return ResolvedTypeX.MISSING;
}
return new Member(Member.STATIC_INITIALIZATION, getEnclosingType(), 0,
ResolvedTypeX.VOID, "<clinit>", TypeX.NONE);
} else if (context instanceof AbstractMethodDeclaration) {
- return world.makeResolvedMember(((AbstractMethodDeclaration)context).binding);
+ return EclipseFactory.makeResolvedMember(((AbstractMethodDeclaration)context).binding);
} else {
return null;
}
if (astNode instanceof AllocationExpression) {
AllocationExpression e = (AllocationExpression)astNode;
return new EclipseShadow(world, Shadow.ConstructorCall,
- world.makeResolvedMember(e.binding), astNode, context);
+ EclipseFactory.makeResolvedMember(e.binding), astNode, context);
} else if (astNode instanceof MessageSend) {
MessageSend e = (MessageSend)astNode;
if (e.isSuperAccess()) return null; // super calls don't have shadows
return new EclipseShadow(world, Shadow.MethodCall,
- world.makeResolvedMember(e.binding), astNode, context);
+ EclipseFactory.makeResolvedMember(e.binding), astNode, context);
} else if (astNode instanceof ExplicitConstructorCall) {
//??? these should be ignored, they don't have shadows
return null;
//throw new RuntimeException("unimplemented: " + e);
}
return new EclipseShadow(world, kind,
- world.makeResolvedMember(e.binding), astNode, context);
+ EclipseFactory.makeResolvedMember(e.binding), astNode, context);
} else if (astNode instanceof TypeDeclaration) {
return new EclipseShadow(world, Shadow.StaticInitialization,
new Member(Member.STATIC_INITIALIZATION,
- world.fromBinding(((TypeDeclaration)astNode).binding), 0,
+ EclipseFactory.fromBinding(((TypeDeclaration)astNode).binding), 0,
ResolvedTypeX.VOID, "<clinit>", TypeX.NONE),
astNode, context);
} else {
import org.aspectj.ajdt.internal.compiler.ast.*;
import org.aspectj.ajdt.internal.core.builder.EclipseSourceContext;
import org.aspectj.bridge.IMessage;
-import org.aspectj.bridge.ISourceLocation;
+//import org.aspectj.bridge.ISourceLocation;
import org.aspectj.weaver.*;
import org.aspectj.weaver.patterns.PerClause;
import org.aspectj.weaver.patterns.PerSingleton;
continue;
} else {
if (amd.binding == null || !amd.binding.isValidBinding()) continue;
- declaredMethods.add(eclipseWorld().makeResolvedMember(amd.binding));
+ declaredMethods.add(EclipseFactory.makeResolvedMember(amd.binding));
}
}
}
FieldBinding[] fields = binding.fields();
for (int i=0, len=fields.length; i < len; i++) {
FieldBinding f = fields[i];
- declaredFields.add(eclipseWorld().makeResolvedMember(f));
+ declaredFields.add(EclipseFactory.makeResolvedMember(f));
}
this.declaredPointcuts = (ResolvedPointcutDefinition[])
import org.aspectj.weaver.NewMethodTypeMunger;
import org.aspectj.weaver.ResolvedTypeMunger;
import org.aspectj.weaver.ResolvedTypeX;
-import org.aspectj.weaver.TypeX;
+//import org.aspectj.weaver.TypeX;
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
-import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+//import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
this.reader = new SimpleSyntheticAccessMethodBinding(
inAspect.factory.makeMethodBinding(
AjcMemberMaker.inlineAccessMethodForFieldGet(
- inAspect.typeX, inAspect.factory.makeResolvedMember(baseField)
+ inAspect.typeX, EclipseFactory.makeResolvedMember(baseField)
)));
this.writer = new SimpleSyntheticAccessMethodBinding(inAspect.factory.makeMethodBinding(
AjcMemberMaker.inlineAccessMethodForFieldSet(
- inAspect.typeX, inAspect.factory.makeResolvedMember(baseField)
+ inAspect.typeX, EclipseFactory.makeResolvedMember(baseField)
)));
this.constant = ASTNode.NotAConstant;
// }
// }
- private ReferenceBinding getTargetType(MethodBinding m2) {
- if (m2 instanceof InterTypeMethodBinding) {
- return ((InterTypeMethodBinding)m2).getTargetType();
- }
-
- return m2.declaringClass;
- }
+// private ReferenceBinding getTargetType(MethodBinding m2) {
+// if (m2 instanceof InterTypeMethodBinding) {
+// return ((InterTypeMethodBinding)m2).getTargetType();
+// }
+//
+// return m2.declaringClass;
+// }
this.reader = new SimpleSyntheticAccessMethodBinding(
inAspect.factory.makeMethodBinding(
AjcMemberMaker.privilegedAccessMethodForFieldGet(
- inAspect.typeX, inAspect.factory.makeResolvedMember(baseField)
+ inAspect.typeX, EclipseFactory.makeResolvedMember(baseField)
)));
this.writer = new SimpleSyntheticAccessMethodBinding(inAspect.factory.makeMethodBinding(
AjcMemberMaker.privilegedAccessMethodForFieldSet(
- inAspect.typeX, inAspect.factory.makeResolvedMember(baseField)
+ inAspect.typeX, EclipseFactory.makeResolvedMember(baseField)
)));
this.constant = ASTNode.NotAConstant;
}
public FieldBinding getPrivilegedAccessField(FieldBinding baseField, ASTNode location) {
- ResolvedMember key = inAspect.factory.makeResolvedMember(baseField);
+ ResolvedMember key = EclipseFactory.makeResolvedMember(baseField);
if (accessors.containsKey(key)) return (FieldBinding)accessors.get(key);
FieldBinding ret = new PrivilegedFieldBinding(inAspect, baseField);
checkWeaveAccess(key.getDeclaringType(), location);
import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.Literal;
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
-import org.eclipse.jdt.internal.compiler.ast.OperatorExpression;
+//import org.eclipse.jdt.internal.compiler.ast.OperatorExpression;
import org.eclipse.jdt.internal.compiler.ast.OperatorIds;
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
// handle modifiers, only without privileged for now
if (isPrivileged) {
pos = eatIdentifier(); // eat the privileged
- int end = (int) pos;
- int start = (int) (pos >>> 32);
+// int end = (int) pos;
+// int start = (int) (pos >>> 32);
aspectDecl.isPrivileged = true;
//problemReporter().signalError(start, end, "privileged is unimplemented in 1.1alpha1");
}
//the name
long pos = identifierPositionStack[identifierPtr];
- int sourceEnd = (int) pos;
+// int sourceEnd = (int) pos;
ret.sourceStart = (int) (pos >>> 32);
ret.selector = identifierStack[identifierPtr--];
identifierLengthPtr--;
CompilationResult unitResult)
{
if (severity != Ignore && DUMP_STACK) {
- Thread.currentThread().dumpStack();
+ Thread.dumpStack();
}
super.handle(
problemId,
import org.aspectj.ajdt.internal.compiler.parser.AjParser;
import org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter;
import org.aspectj.asm.*;
-import org.aspectj.asm.internal.*;
+//import org.aspectj.asm.internal.*;
import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.bridge.*;
import org.aspectj.weaver.World;
import org.eclipse.jdt.internal.compiler.env.*;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
+//import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
public class AjBuildManager {
static final boolean FAIL_IF_RUNTIME_NOT_FOUND = false;
// have to tell state we succeeded or next is not incremental
state.successfulCompile(buildConfig);
- boolean weaved = weaveAndGenerateClassFiles();
+ /*boolean weaved = */weaveAndGenerateClassFiles();
// if not weaved, then no-op build, no model changes
// but always returns true
// XXX weaved not in Mik's incremental
bcelWeaver.addLibraryJarFile(f);
}
- String lintMode = buildConfig.getLintMode();
+// String lintMode = buildConfig.getLintMode();
if (buildConfig.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT)) {
bcelWorld.getLint().loadDefaultProperties();
public CompilationUnit[] getCompilationUnits(String[] filenames, String[] encodings) {
int fileCount = filenames.length;
CompilationUnit[] units = new CompilationUnit[fileCount];
- HashtableOfObject knownFileNames = new HashtableOfObject(fileCount);
+// HashtableOfObject knownFileNames = new HashtableOfObject(fileCount);
String defaultEncoding = (String) buildConfig.getJavaOptions().get(CompilerOptions.OPTION_Encoding);
if ("".equals(defaultEncoding)) //$NON-NLS-1$
setParameters(methodDeclaration, node);
} else if (methodDeclaration instanceof PointcutDeclaration) {
- PointcutDeclaration pd = (PointcutDeclaration)methodDeclaration;
+// PointcutDeclaration pd = (PointcutDeclaration)methodDeclaration;
node.setKind(IProgramElement.Kind.POINTCUT);
node.setName(translatePointcutName(new String(methodDeclaration.selector)));
setParameters(methodDeclaration, node);
node.setKind(IProgramElement.Kind.INTER_TYPE_FIELD);
} else if (methodDeclaration instanceof InterTypeMethodDeclaration) {
node.setKind(IProgramElement.Kind.INTER_TYPE_METHOD);
- InterTypeMethodDeclaration itmd = (InterTypeMethodDeclaration)methodDeclaration;
+// InterTypeMethodDeclaration itmd = (InterTypeMethodDeclaration)methodDeclaration;
} else if (methodDeclaration instanceof InterTypeConstructorDeclaration) {
node.setKind(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR);
- InterTypeConstructorDeclaration itcd = (InterTypeConstructorDeclaration)methodDeclaration;
+// InterTypeConstructorDeclaration itcd = (InterTypeConstructorDeclaration)methodDeclaration;
} else {
node.setKind(IProgramElement.Kind.ERROR);
}
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.asm.*;
-import org.aspectj.asm.internal.*;
+//import org.aspectj.asm.internal.*;
import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.bridge.*;
import org.aspectj.util.LangUtil;
}
public boolean visit(TypeDeclaration memberTypeDeclaration, BlockScope scope) {
- String name = new String(memberTypeDeclaration.name);
+// String name = new String(memberTypeDeclaration.name);
String fullName = "<undefined>";
if (memberTypeDeclaration.binding != null
// AMC - overloaded set of methods to get start and end lines for
// various ASTNode types. They have no common ancestor in the
// hierarchy!!
- private int getStartLine( AbstractVariableDeclaration avd ) {
- return ProblemHandler.searchLineNumber(
- currCompilationResult.lineSeparatorPositions,
- avd.declarationSourceStart);
- }
+// private int getStartLine( AbstractVariableDeclaration avd ) {
+// return ProblemHandler.searchLineNumber(
+// currCompilationResult.lineSeparatorPositions,
+// avd.declarationSourceStart);
+// }
// AMC - overloaded set of methods to get start and end lines for
// various ASTNode types. They have no common ancestor in the
// AMC - overloaded set of methods to get start and end lines for
// various ASTNode types. They have no common ancestor in the
// hierarchy!!
- private int getStartLine( AbstractMethodDeclaration amd ){
- return ProblemHandler.searchLineNumber(
- currCompilationResult.lineSeparatorPositions,
- amd.declarationSourceStart);
- }
+// private int getStartLine( AbstractMethodDeclaration amd ){
+// return ProblemHandler.searchLineNumber(
+// currCompilationResult.lineSeparatorPositions,
+// amd.declarationSourceStart);
+// }
// AMC - overloaded set of methods to get start and end lines for
// various ASTNode types. They have no common ancestor in the
// AMC - overloaded set of methods to get start and end lines for
// various ASTNode types. They have no common ancestor in the
// hierarchy!!
- private int getStartLine( TypeDeclaration td ){
- return ProblemHandler.searchLineNumber(
- currCompilationResult.lineSeparatorPositions,
- td.declarationSourceStart);
- }
+// private int getStartLine( TypeDeclaration td ){
+// return ProblemHandler.searchLineNumber(
+// currCompilationResult.lineSeparatorPositions,
+// td.declarationSourceStart);
+// }
// AMC - overloaded set of methods to get start and end lines for
// various ASTNode types. They have no common ancestor in the
print(") ");
}
- private void printDecls(IRelationship node) {
-// for (Iterator it = node.getTargets().iterator(); it.hasNext(); ) {
-// // this ignores relations on the compile unit
-// Object nodeObject = it.next();
-// throw new RuntimeException("unimplemented");
-//// if (nodeObject instanceof LinkNode) {
-//// LinkNode child = (LinkNode)nodeObject;
-//// if (//!child.getProgramElementNode().getKind().equals("stmnt") &&
-//// !child.getProgramElementNode().getKind().equals("<undefined>")) {
-//// printDecl(child.getProgramElementNode(), false);
+// private void printDecls(IRelationship node) {
+//// for (Iterator it = node.getTargets().iterator(); it.hasNext(); ) {
+//// // this ignores relations on the compile unit
+//// Object nodeObject = it.next();
+//// throw new RuntimeException("unimplemented");
+////// if (nodeObject instanceof LinkNode) {
+////// LinkNode child = (LinkNode)nodeObject;
+////// if (//!child.getProgramElementNode().getKind().equals("stmnt") &&
+////// !child.getProgramElementNode().getKind().equals("<undefined>")) {
////// printDecl(child.getProgramElementNode(), false);
-//// }
-//// }
-// }
- }
+//////// printDecl(child.getProgramElementNode(), false);
+////// }
+////// }
+//// }
+// }
/**
* @param structureNode can be a ProgramElementNode or a LinkNode
subst(n, o, (in.substring(pos + o.length())));
}
- private void lose(Error e) {
- try {
- print("(ERROR \"" + e.toString() + "\")");
- }
- catch(Error ex) { }
- }
+// private void lose(Error e) {
+// try {
+// print("(ERROR \"" + e.toString() + "\")");
+// }
+// catch(Error ex) { }
+// }
}
}
package org.aspectj.ajdt.internal.core.builder;
-import java.util.HashMap;
+//import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
-import java.util.Arrays;
-import java.util.List;
-
-import org.aspectj.ajdt.ajc.BuildArgParser;
+//import java.util.Arrays;
+//import java.util.List;
+//
+//import org.aspectj.ajdt.ajc.BuildArgParser;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.ICommand;
import org.aspectj.bridge.IMessage;
return;
}
try {
- boolean verbose = (-1 != ("" + Arrays.asList(args)).indexOf("-verbose"));
+// boolean verbose = (-1 != ("" + Arrays.asList(args)).indexOf("-verbose"));
outer:
while (true) {
boolean passed = command.runCommand(args, holder);
if (report(passed, holder) && controller.incremental()) {
- final boolean onCommandLine = controller.commandLineIncremental();
+// final boolean onCommandLine = controller.commandLineIncremental();
while (controller.doRepeatCommand()) {
holder.clearMessages();
if (controller.buildFresh()) {
* @return String rendering IMessage (never null)
*/
protected String render(IMessage message) {
- IMessage.Kind kind = message.getKind();
+// IMessage.Kind kind = message.getKind();
StringBuffer sb = new StringBuffer();
String text = message.getMessage();
*/
public String[] init(String[] args, IMessageHandler sink) {
running = true;
- String[] unused;
+// String[] unused;
if (!LangUtil.isEmpty(args)) {
String[][] options = LangUtil.copyStrings(OPTIONS);
- unused = LangUtil.extractOptions(args, options);
+ /*unused = */LangUtil.extractOptions(args, options);
incremental = (null != options[0][0]);
if (null != options[1][0]) {
File file = new File(options[1][1]);
}
System.out.println(" press enter to recompile, r to rebuild, q to quit: ");
System.out.flush();
- boolean doMore = false;
+// boolean doMore = false;
// seek for one q or a series of [\n\r]...
do {
int input = System.in.read();
/** delay between filesystem checks, returning if quit is set */
protected void fileCheckDelay() {
- final Thread thread = Thread.currentThread();
+// final Thread thread = Thread.currentThread();
long targetTime = System.currentTimeMillis() + delay;
- long curTime;
- while (targetTime > (curTime = System.currentTimeMillis())) {
+// long curTime;
+ while (targetTime > System.currentTimeMillis()) {
if (quit) {
return;
}
package org.aspectj.ajdt.ajc;
-import org.aspectj.ajdt.internal.core.builder.AjBuildConfig;
+//import org.aspectj.ajdt.internal.core.builder.AjBuildConfig;
import org.aspectj.bridge.*;
import org.aspectj.util.*;
import org.eclipse.jdt.core.compiler.InvalidInputException;
private ArrayList tempFiles = new ArrayList();
private StreamPrintWriter outputWriter = new StreamPrintWriter(new PrintWriter(System.out));
- private AjdtCommand command = new AjdtCommand();
+// private AjdtCommand command = new AjdtCommand();
private MessageWriter messageWriter = new MessageWriter(outputWriter, false);
private CountingMessageHandler counter
= new CountingMessageHandler(messageWriter);
}
public void testIncrementalOption() throws InvalidInputException {
- AjBuildConfig config = command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
new String[] { "-incremental" },
counter);
outputWriter.getContents().indexOf("specify a source root") != -1);
outputWriter.flushBuffer();
- config = command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
new String[] { "-incremental", "-sourceroots",
AjdtAjcTests.TESTDATA_PATH + "/src1" },
counter);
outputWriter.getContents().equals(""));
outputWriter.flushBuffer();
- config = command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
new String[] { "-incremental", "testdata/src1/Hello.java" },
counter);
public void testBadOptionAndUsagePrinting() throws InvalidInputException {
try {
- command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
new String[] { "-mubleBadOption" },
counter);
} catch (AbortException ae) { }
try {
try {
- command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
args,
counter);
} catch (AbortException ae) { }
try {
try {
- command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
args,
counter);
} catch (AbortException ae) { }
}
public void testNonExistingLstFile() {
- command.genBuildConfig(
+ AjdtCommand.genBuildConfig(
new String[] { "@mumbleDoesNotExist" },
counter);
System.setProperty("java.class.path", ENTRY); // see finally below
BuildArgParser parser = new BuildArgParser(messageWriter);
AjBuildConfig config = parser.genBuildConfig(new String[] { });
- String err = parser.getOtherMessages(true);
+ /*String err = */parser.getOtherMessages(true);
//!!!assertTrue(err, null == err);
assertTrue(
config.getClasspath().toString(),
parser = new BuildArgParser(messageWriter);
config = parser.genBuildConfig(new String[] { "-1.3" });
- err = parser.getOtherMessages(true);
+ /*err = */parser.getOtherMessages(true);
//!!!assertTrue(err, null == err);
assertTrue(
config.getClasspath().toString(),
public void testBadPathToSourceFiles() {
CountingMessageHandler countingHandler = new CountingMessageHandler(messageWriter);
- AjBuildConfig config = genBuildConfig(new String[]{ "inventedDir/doesntexist/*.java"},countingHandler);
+ /*AjBuildConfig config = */genBuildConfig(new String[]{ "inventedDir/doesntexist/*.java"},countingHandler);
assertTrue("Expected an error for the invalid path.",countingHandler.numMessages(IMessage.ERROR,false)==1);
}
}
public void testXlint() throws InvalidInputException {
- AjdtCommand command = new AjdtCommand();
+// AjdtCommand command = new AjdtCommand();
AjBuildConfig config = genBuildConfig(new String[] {"-Xlint"}, messageWriter);
assertTrue("", config.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT));
config = genBuildConfig(new String[] {"-Xlint:warn"}, messageWriter);
public void testXlintfile() throws InvalidInputException {
String lintFile = AjdtAjcTests.TESTDATA_PATH + "/lintspec.properties";
- String badLintFile = "lint.props";
+// String badLintFile = "lint.props";
AjBuildConfig config = genBuildConfig(new String[] {"-Xlintfile", lintFile}, messageWriter);
assertTrue(new File(lintFile).exists());
assertEquals(getCanonicalPath(new File(lintFile)),config.getLintSpecFile().getAbsolutePath());
}
public void testOptions() throws InvalidInputException {
- AjdtCommand command = new AjdtCommand();
+// AjdtCommand command = new AjdtCommand();
String TARGET = "1.4";
AjBuildConfig config = genBuildConfig(new String[] {"-target", TARGET, "-source", TARGET}, messageWriter);
assertTrue(
String SOURCE_PATH_1 = "A.java";
String SOURCE_PATH_2 = "B.java";
- File f = new File(FILE_PATH);
+// File f = new File(FILE_PATH);
AjBuildConfig config = genBuildConfig(new String[] { "@" + FILE_PATH }, messageWriter);
List resultList = config.getFiles();
import java.io.File;
import java.util.ArrayList;
-import java.util.Arrays;
+//import java.util.Arrays;
import java.util.List;
import org.aspectj.ajdt.ajc.*;
import org.aspectj.ajdt.ajc.AjdtCommand;
import org.aspectj.bridge.ICommand;
-import org.aspectj.bridge.IMessage;
+//import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.MessageHandler;
/**
ICommand command = new AjdtCommand();
MessageHandler myHandler = new MessageHandler();
//myHandler.setInterceptor(org.aspectj.tools.ajc.Main.MessagePrinter.TERSE);
- boolean result = command.runCommand((String[])args.toArray(new String[args.size()]), myHandler);
+ /*boolean result = */command.runCommand((String[])args.toArray(new String[args.size()]), myHandler);
//System.err.println("messages: " + Arrays.asList(myHandler.getMessages(IMessage.INFO, true)));
// DON'T yet have a way of testing that we actually got a particular info message
ICommand command = new AjdtCommand();
MessageHandler myHandler = new MessageHandler();
myHandler.setInterceptor(org.aspectj.tools.ajc.Main.MessagePrinter.TERSE);
- boolean result = command.runCommand((String[])args.toArray(new String[args.size()]), myHandler);
+ /*boolean result = */command.runCommand((String[])args.toArray(new String[args.size()]), myHandler);
assertEquals("error for org.aspectj.lang.JoinPoint not found", 1, myHandler.getErrors().length);
}
public void rerunCompiler(ICommand command) {
MessageHandler myHandler = new MessageHandler();
- List recompiledFiles = new ArrayList();
+// List recompiledFiles = new ArrayList();
if (!command.repeatCommand(myHandler)) {
assertTrue("recompile failed", false);
}
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
-import java.util.Enumeration;
+//import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
public static void main(String[] args) throws IOException {
IncrementalCase me = new IncrementalCase();
MessageHandler h = new MessageHandler();
- boolean result;
+// boolean result;
StringBuffer sb = new StringBuffer();
for (int i = 0; i < args.length; i++) {
sb.append("\n###### results for " + args[i]);
boolean result = true;
final String toSuffix = ".java";
- final String canonicalFrom = srcBase.getCanonicalPath();
+// final String canonicalFrom = srcBase.getCanonicalPath();
final Definition[] defs = getDefinitions(srcBase);
if ((null == defs) || (defs.length < 9)) {
throw new Error("did not get definitions");
String[] eclipseErrors;
String[] eclipseWarnings;
Definition(String prefix, Properties props) {
- Enumeration keys = props.keys();
+// Enumeration keys = props.keys();
this.prefix = prefix;
files = get(props, prefix + ".files");
recompiled = get(props, prefix + ".recompiled");
package org.aspectj.ajdt.internal.core.builder;
import java.io.File;
-import java.io.FileOutputStream;
+//import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
// }
// }
- private void touch(File file, boolean isAppend) throws IOException {
- FileOutputStream s = new FileOutputStream(file.getAbsolutePath(), isAppend);
- s.write(new byte[] {1,2,3});
- s.close();
- }
+// private void touch(File file, boolean isAppend) throws IOException {
+// FileOutputStream s = new FileOutputStream(file.getAbsolutePath(), isAppend);
+// s.write(new byte[] {1,2,3});
+// s.close();
+// }
/*
import org.aspectj.util.FileUtil;
import java.io.File;
-import java.io.FileFilter;
-import java.io.FileWriter;
-import java.io.IOException;
+//import java.io.FileFilter;
+//import java.io.FileWriter;
+//import java.io.IOException;
/**
* Adapt ajc to javac commands.
line = line.substring(0, isharp);
}
- int istar = -1;
+// int istar = -1;
// Argument
if (line.startsWith("-")) {
}
// If there are stars we'll try to resolve the file here
- else if ((istar = line.indexOf("*")) != -1) {
+ else if (line.indexOf("*") != -1) {
log("The argfile line '" + line + "' is invalid",
Project.MSG_WARN);
}
}
}
- private void addFile(File file) {
- if (null != file) {
- String path = file.getAbsolutePath();
- addFlag(path, true);
- }
- }
+// private void addFile(File file) {
+// if (null != file) {
+// String path = file.getAbsolutePath();
+// addFlag(path, true);
+// }
+// }
List extractArguments() {
ArrayList result = new ArrayList();