Determine what modifications are needed and perform them
//@olsen: added support for timing statistics
try{
if (env.doTimingStatistics()) {
Support.timer.push("EnhancerControl.modifyClasses()");//NOI18N
}
final ArrayList classes = env.collectClasses();
if (classes.size() > 1) {
env.messageNL("scanning classes");//NOI18N
}
// First examine the classes, noting the class characteristics
for (Iterator e = classes.iterator(); e.hasNext();) {
ClassControl cc = (ClassControl)e.next();
cc.scan1();
if (false) {
dumpClass(cc);
}
}
//@olsen: disabled feature
/*
// Possibly update package names
retargetClasses();
*/
if (env.errorCount() > 0)
return;
if (classes.size() > 1) {
env.messageNL("augmenting classes");//NOI18N
}
// Change class inheritance
for (Iterator e = classes.iterator(); e.hasNext();) {
ClassControl cc = (ClassControl)e.next();
//@olsen: subst: augmentInterfaces -> augment
cc.augment();
if (false) {
dumpClass(cc);
}
}
if (env.errorCount() > 0)
return;
if (classes.size() > 1) {
env.messageNL("annotating classes");//NOI18N
}
// Then perform the annotation actions
for (Iterator e = classes.iterator(); e.hasNext();) {
ClassControl cc = (ClassControl)e.next();
cc.annotate();
if (false) {
dumpClass(cc);
}
}
} finally {
if (env.doTimingStatistics()) {
Support.timer.pop();
}
}