// Undocumented option. To be used for testing purpose only
parseonly = booleanValue(value);
}
}
String fileName = args[args.length - 1];
Snapshot model = null;
File excludeFile = null;
if (excludeFileName != null) {
excludeFile = new File(excludeFileName);
if (!excludeFile.exists()) {
System.out.println("Exclude file " + excludeFile
+ " does not exist. Aborting.");
System.exit(1);
}
}
System.out.println("Reading from " + fileName + "...");
try {
model = com.sun.tools.hat.internal.parser.Reader.readFile(fileName, callStack, debugLevel);
} catch (IOException ex) {
ex.printStackTrace();
System.exit(1);
} catch (RuntimeException ex) {
ex.printStackTrace();
System.exit(1);
}
System.out.println("Snapshot read, resolving...");
model.resolve(calculateRefs);
System.out.println("Snapshot resolved.");
if (excludeFile != null) {
model.setReachableExcludes(new ReachableExcludesImpl(excludeFile));
}
if (baselineDump != null) {
System.out.println("Reading baseline snapshot...");
Snapshot baseline = null;
try {
baseline = com.sun.tools.hat.internal.parser.Reader.readFile(baselineDump, false,
debugLevel);
} catch (IOException ex) {
ex.printStackTrace();
System.exit(1);
} catch (RuntimeException ex) {
ex.printStackTrace();
System.exit(1);
}
baseline.resolve(false);
System.out.println("Discovering new objects...");
model.markNewRelativeTo(baseline);
baseline = null; // Guard against conservative GC
}
if ( debugLevel == 2 ) {