}
public void checkSpec(ClassScope scope) {
- if (ignoreFurtherInvestigation)
+ if (ignoreFurtherInvestigation) {
return;
+ }
if (dominatesPattern != null) {
scope.problemReporter().signalError(
dominatesPattern.getStart(),
Annotation atAspectAnnotation = AtAspectJAnnotationFactory.createAspectAnnotation(perClause.toDeclarationString(),
declarationSourceStart);
Annotation privilegedAnnotation = null;
- if (isPrivileged)
+ if (isPrivileged) {
privilegedAnnotation = AtAspectJAnnotationFactory.createPrivilegedAnnotation(declarationSourceStart);
+ }
Annotation[] toAdd = new Annotation[isPrivileged ? 2 : 1];
toAdd[0] = atAspectAnnotation;
- if (isPrivileged)
+ if (isPrivileged) {
toAdd[1] = privilegedAnnotation;
+ }
if (annotations == null) {
annotations = toAdd;
} else {
public void generateCode(ClassFile enclosingClassFile) {
if (ignoreFurtherInvestigation) {
- if (binding == null)
+ if (binding == null) {
return;
+ }
ClassFile.createProblemType(this, scope.referenceCompilationUnit().compilationResult);
return;
}
}
}
- if (EclipseFactory.DEBUG)
+ if (EclipseFactory.DEBUG) {
System.out.println(toString());
+ }
super.generateCode(enclosingClassFile);
}
}
protected void generateAttributes(ClassFile classFile) {
- if (!isAbstract())
+ if (!isAbstract()) {
generatePerSupportMembers(classFile);
+ }
generateInlineAccessMembers(classFile);
classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.Aspect(perClause)));
if (binding.privilegedHandler != null) {
- // Only build the attribute if necessary
- PrivilegedHandler privilegedHandler= (PrivilegedHandler)binding.privilegedHandler;
+ // Only build the attribute if necessary
+ PrivilegedHandler privilegedHandler = (PrivilegedHandler) binding.privilegedHandler;
ResolvedMember[] members = privilegedHandler.getMembers();
- if (members.length>0) {
+ if (members.length > 0) {
classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.PrivilegedAttribute(members)));
}
}
private void addVersionAttributeIfNecessary(ClassFile classFile) {
for (Iterator iter = classFile.extraAttributes.iterator(); iter.hasNext();) {
EclipseAttributeAdapter element = (EclipseAttributeAdapter) iter.next();
- if (CharOperation.equals(element.getNameChars(), weaverVersionChars))
+ if (CharOperation.equals(element.getNameChars(), weaverVersionChars)) {
return;
+ }
}
classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.WeaverVersionInfo()));
}
}
private void generatePerSupportMembers(ClassFile classFile) {
- if (isAbstract())
+ if (isAbstract()) {
return;
+ }
// XXX otherwise we need to have this (error handling?)
- if (aspectOfMethod == null)
+ if (aspectOfMethod == null) {
return;
+ }
if (perClause == null) {
System.err.println("has null perClause: " + this);
return;
// body starts here
gen.generate(codeStream);
// body ends here
- if (codeStream.pcToSourceMapSize == 0)
+ if (codeStream.pcToSourceMapSize == 0) {
codeStream.recordPositionsFrom(0, 1);
+ }
boolean b = ((codeStream.generateAttributes & ClassFileConstants.ATTR_VARS) != 0 ? true : false); // pr148693
if (codeStream.maxLocals == 0) {
codeStream.generateAttributes &= ~ClassFileConstants.ATTR_VARS;
}
classFile.completeCodeAttribute(codeAttributeOffset);
- if (b)
+ if (b) {
codeStream.generateAttributes |= ClassFileConstants.ATTR_VARS;
+ }
attributeNumber++;
classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
// aspectAttribute = new AjAttribute.Aspect(perClause);
- if (ignoreFurtherInvestigation)
+ if (ignoreFurtherInvestigation) {
return; // ???
+ }
if (!isAbstract()) {
if (perClause.getKind() == PerClause.SINGLETON) {
}
checkSpec(classScope);
- if (ignoreFurtherInvestigation)
+ if (ignoreFurtherInvestigation) {
return;
+ }
buildPerClause(scope);
for (int i = 0; i < methods.length; i++) {
if (methods[i] instanceof InterTypeDeclaration) {
EclipseTypeMunger m = ((InterTypeDeclaration) methods[i]).build(classScope);
- if (m != null)
+ if (m != null) {
concreteName.typeMungers.add(m);
+ }
} else if (methods[i] instanceof DeclareDeclaration) {
Declare d = ((DeclareDeclaration) methods[i]).build(classScope);
- if (d != null)
+ if (d != null) {
concreteName.declares.add(d);
+ }
}
}
}
if (superInterfaces != null && superInterfaces.length > 0) {
output.append((TypeDeclaration.kind(this.modifiers) == TypeDeclaration.INTERFACE_DECL) ? " extends " : " implements ");//$NON-NLS-2$ //$NON-NLS-1$
for (int i = 0; i < superInterfaces.length; i++) {
- if (i > 0)
+ if (i > 0) {
output.append(", "); //$NON-NLS-1$
+ }
superInterfaces[i].print(0, output);
}
}