8054898: Avoid creation of empty type info files
Reviewed-by: attila, sundar, jlaskey
--- a/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java Tue Aug 12 13:22:05 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java Tue Aug 12 13:23:47 2014 +0200
@@ -107,7 +107,7 @@
*/
@SuppressWarnings("resource")
public static void store(final Object locationDescriptor, final Map<Integer, Type> optimisticTypes) {
- if(locationDescriptor == null) {
+ if(locationDescriptor == null || optimisticTypes.isEmpty()) {
return;
}
final File file = ((LocationDescriptor)locationDescriptor).file;