private Toolchain getToolchain() {
Toolchain tc = null;
try {
if (session != null) //session is null in tests..
{
ToolchainManager toolchainManager =
(ToolchainManager)session.getContainer().lookup(ToolchainManager.ROLE);
if (toolchainManager != null) {
tc = toolchainManager.getToolchainFromBuildContext("jdk", session);
}
}
} catch (ComponentLookupException componentLookupException) {
//just ignore, could happen in pre-3.0.9 builds..
}