8054898: Avoid creation of empty type info files
authorhannesw
Tue, 12 Aug 2014 13:23:47 +0200
changeset 26061 cf60b442cf78
parent 26060 50a029a28ecb
child 26062 13bf95834477
8054898: Avoid creation of empty type info files Reviewed-by: attila, sundar, jlaskey
nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
--- 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;