createFont(int fontFormat, InputStream fontStream) method creates tmp files with name pattern “~+JF<<random_number>>.tmp ” for each request but deletes only on application stop.
As Security. getSecurityManager() is always null. so the font tracker is not getting created to track font files.
The below method in the font file always returns true. private static boolean hasTempPermission() {
if (System.getSecurityManager() == null) {
return true;
}
File f = null;
boolean hasPerm = false;
try {
f = File.createTempFile("+~JT", ".tmp", null);
f.delete();
f = null;
hasPerm = true;
} catch (Throwable t) {
/\* inc. any kind of SecurityException \*/
}
return hasPerm;
}
That's why create font function if condition to get font tracker not executing. if (!hasTempPermission()) {
tracker = CreatedFontTracker.getTracker();
}