changeset 11:cd6626baaedd

CODETOOLS-7901084, CODETOOLS-7901078, CODETOOLS-7901071, CODETOOLS-7900971
author afedorch
date Thu, 20 Nov 2014 18:24:34 +0400
parents a463e2b9cfef
children df2c4155dc25
files src/classes/com/sun/tdk/jcov/JREInstr.java src/classes/com/sun/tdk/jcov/ant/Report.java src/classes/com/sun/tdk/jcov/instrument/OverriddenClassWriter.java src/classes/com/sun/tdk/jcov/report/html/resources/style.css src/classes/com/sun/tdk/jcov/report/javap/JavapClass.java src/classes/com/sun/tdk/jcov/report/javap/JavapRepGen.java src/classes/com/sun/tdk/jcov/runtime/Collect.java src/classes/com/sun/tdk/jcov/runtime/JCovSESocketSaver.java
diffstat 8 files changed, 268 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/src/classes/com/sun/tdk/jcov/JREInstr.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/JREInstr.java	Thu Nov 20 18:24:34 2014 +0400
@@ -25,7 +25,6 @@
 package com.sun.tdk.jcov;
 
 import com.sun.tdk.jcov.runtime.JCovSESocketSaver;
-import com.sun.tdk.jcov.runtime.JCovSocketSaver;
 import com.sun.tdk.jcov.tools.EnvHandler;
 import com.sun.tdk.jcov.tools.JCovCMDTool;
 import com.sun.tdk.jcov.tools.OptionDescr;
@@ -33,7 +32,6 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStreamWriter;
@@ -41,6 +39,7 @@
 import java.net.URLClassLoader;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -61,6 +60,7 @@
     private Instr instr;
     private File toInstrument;
     private File[] addJars;
+    private File[] addJimages;
     private File[] addTests;
     private File implant;
     private File javac;
@@ -108,7 +108,54 @@
         StaticJREInstrClassLoader cl = new StaticJREInstrClassLoader(new URL[]{toInstrument.toURI().toURL()});
         instr.setClassLoader(cl);
 
-        instr.instrumentFile(toInstrument.getAbsolutePath(), null, implant.getAbsolutePath());
+        if (toInstrument.getAbsolutePath().endsWith("bootmodules.jimage")){
+
+            ArrayList<File> jdkImages = new ArrayList<File>();
+            jdkImages.add(toInstrument);
+            if (addJimages != null) {
+                Collections.addAll(jdkImages, addJimages);
+            }
+
+            for (File jimageInstr: jdkImages) {
+                String tempDirName = jimageInstr.getName().substring(0, jimageInstr.getName().indexOf(".jimage"));
+
+                expandJimage(jimageInstr, tempDirName);
+
+                File dirtoInstrument = new File(jimageInstr.getParent(), tempDirName);
+                Utils.addToClasspath(new String[]{dirtoInstrument.getAbsolutePath()});
+                if (jimageInstr.equals(toInstrument)) {
+                    instr.instrumentFile(dirtoInstrument.getAbsolutePath(), null, implant.getAbsolutePath());
+                }
+                else{
+                    instr.instrumentFile(dirtoInstrument.getAbsolutePath(), null, null);
+                }
+                createJimage(dirtoInstrument, jimageInstr.getAbsolutePath() + "i");
+
+            }
+            for (File jimageInstr: jdkImages) {
+
+                String tempDirName = jimageInstr.getName().substring(0, jimageInstr.getName().indexOf(".jimage"));
+                File dirtoInstrument = new File(jimageInstr.getParent(), tempDirName);
+                if (!Utils.deleteDirectory(dirtoInstrument)) {
+                    logger.log(Level.SEVERE, "please, delete " + tempDirName + " jimage dir manually");
+                }
+
+                Utils.copyFile(jimageInstr, new File(jimageInstr.getParent(), jimageInstr.getName() + ".bak"));
+
+                if(!jimageInstr.delete()){
+                    logger.log(Level.SEVERE, "please, delete original jimage manually: "+jimageInstr);
+                }
+                else{
+                    Utils.copyFile(new File(jimageInstr.getAbsolutePath()+"i"), jimageInstr);
+                    new File(jimageInstr.getAbsolutePath()+"i").delete();
+                }
+
+            }
+
+        }
+        else {
+            instr.instrumentFile(toInstrument.getAbsolutePath(), null, implant.getAbsolutePath());
+        }
 
         ArrayList<String> srcs = null;
         if (addJars != null) {
@@ -136,6 +183,41 @@
         return SUCCESS_EXIT_CODE;
     }
 
+
+    private boolean expandJimage(File jimage, String tempDirName){
+        try {
+            String command = jimage.getParentFile().getParentFile().getParent()+File.separator+"bin"+File.separator+"jimage extract --dir "+
+                    jimage.getParent()+File.separator+tempDirName+" "+jimage.getAbsolutePath();
+            Process process = Runtime.getRuntime().exec(command);
+            process.waitFor();
+            if (process.exitValue() != 0) {
+                logger.log(Level.SEVERE, "wrong command for expand jimage: "+command);
+                return false;
+            }
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "exception in process(expanding jimage)", e);
+            return false;
+        }
+        return true;
+    }
+
+    private boolean createJimage(File dir, String new_jimage_path){
+        try {
+            String command = dir.getParentFile().getParentFile().getParent()+File.separator+"bin"+File.separator+"jimage recreate --dir "+
+                    dir + " "+ new_jimage_path;
+            Process process = Runtime.getRuntime().exec(command);
+            process.waitFor();
+            if (process.exitValue() != 0) {
+                logger.log(Level.SEVERE, "wrong command for create jimage: "+command);
+                return false;
+            }
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "exception in process(expanding jimage)", e);
+            return false;
+        }
+        return true;
+    }
+
     @Override
     protected EnvHandler defineHandler() {
         Instr.DSC_INCLUDE_RT.usage = "To run instrumented JRE you should implant JCov runtime library both into rt.jar and into 'lib/endorsed' directory.\nWhen instrumenting whole JRE dir with jreinstr tool - these 2 actions will be done automatically.";
@@ -159,6 +241,7 @@
                     Instr.DSC_SUBSEQUENT,
                     DSC_JAVAC_HACK,
                     DCS_ADD_JAR,
+                    DCS_ADD_JIMAGE,
                     DCS_ADD_TESTS,
                     DSC_HOST,
                     DSC_PORT
@@ -197,6 +280,19 @@
                 }
             }
         }
+        if (envHandler.isSet(DCS_ADD_JIMAGE)) {
+            String[] images = envHandler.getValues(DCS_ADD_JIMAGE);
+            addJimages = new File[images.length];
+            for (int i = 0; i < addJimages.length; ++i) {
+                addJimages[i] = new File(images[i]);
+                if (!addJimages[i].exists()) {
+                    throw new EnvHandlingException("Additional jimage " + images[i] + " doesn't exist");
+                }
+                if (!addJimages[i].canRead()) {
+                    throw new EnvHandlingException("Can't read additional jimage " + images[i]);
+                }
+            }
+        }
 
         if (envHandler.isSet(DCS_ADD_TESTS)) {
             String[] files = envHandler.getValues(DCS_ADD_TESTS);
@@ -318,62 +414,89 @@
             if (!lib.exists()) {
                 throw new EnvHandlingException("lib directory was not found in JRE directory");
             }
-            toInstrument = new File(lib, "rt.jar");
+
+            toInstrument = new File(lib, "modules");
             if (!toInstrument.exists()) {
-                throw new EnvHandlingException("rt.jar directory was not found in lib directory");
-            }
-            if (!toInstrument.isFile() || !toInstrument.canRead() || !toInstrument.canWrite()) {
-                throw new EnvHandlingException("Can't read/write rt.jar (or not a file)");
-            }
-            File bak = new File(lib, "rt.jar.bak");
-            if (!bak.exists()) {
-                try {
-                    Utils.copyFile(toInstrument, bak);
-                } catch (FileNotFoundException ex) {
-                    throw new EnvHandlingException("Error while backuping rt.jar: file not found", ex);
-                } catch (IOException ex) {
-                    throw new EnvHandlingException("Error while backuping rt.jar", ex);
+                toInstrument = new File(lib, "rt.jar");
+                if (!toInstrument.exists()) {
+                    throw new EnvHandlingException("rt.jar directory was not found in lib directory");
                 }
-            } else {
-                if (!envHandler.isSet(Instr.DSC_SUBSEQUENT)) {
-                    throw new EnvHandlingException("Backup rt.jar.bak file exisit. It can mean that JRE is already instrumented - nothing to do. Restore initial rt.jar or delete bak file.");
+                if (!toInstrument.isFile() || !toInstrument.canRead() || !toInstrument.canWrite()) {
+                    throw new EnvHandlingException("Can't read/write rt.jar (or not a file)");
                 }
-            }
-
-            File endorsed = new File(lib, "endorsed");
-            if (!endorsed.exists()) {
-                endorsed.mkdir();
-            } else {
-                if (!endorsed.isDirectory()) {
-                    throw new EnvHandlingException("JRE/lib/endorsed is not a directory");
-                }
-            }
-            File implantcopy = new File(endorsed, implant.getName());
-            try {
-                // copy rt to endorsed dir
-                Utils.copyFile(implant, implantcopy);
-
-                if (host != null || port != null) {
-                    Properties prop = new Properties();
+                File bak = new File(lib, "rt.jar.bak");
+                if (!bak.exists()) {
                     try {
-                        if (host != null) {
-                            prop.setProperty(JCovSESocketSaver.HOST_PROPERTIES_NAME, host);
-                        }
-                        if (port != null) {
-                            prop.setProperty(JCovSESocketSaver.PORT_PROPERTIES_NAME, Integer.toString(port));
-                        }
-                        prop.store(new FileOutputStream(endorsed.getAbsolutePath() + File.separator + JCovSESocketSaver.NETWORK_DEF_PROPERTIES_FILENAME), null);
-
+                        Utils.copyFile(toInstrument, bak);
+                    } catch (FileNotFoundException ex) {
+                        throw new EnvHandlingException("Error while backuping rt.jar: file not found", ex);
                     } catch (IOException ex) {
-                        logger.log(Level.WARNING, "Cannot create property file to save host and port: {0}", ex);
+                        throw new EnvHandlingException("Error while backuping rt.jar", ex);
+                    }
+                } else {
+                    if (!envHandler.isSet(Instr.DSC_SUBSEQUENT)) {
+                        throw new EnvHandlingException("Backup rt.jar.bak file exisit. It can mean that JRE is already instrumented - nothing to do. Restore initial rt.jar or delete bak file.");
                     }
                 }
 
+                File endorsed = new File(lib, "endorsed");
+                if (!endorsed.exists()) {
+                    endorsed.mkdir();
+                } else {
+                    if (!endorsed.isDirectory()) {
+                        throw new EnvHandlingException("JRE/lib/endorsed is not a directory");
+                    }
+                }
+                File implantcopy = new File(endorsed, implant.getName());
+                try {
+                    // copy rt to endorsed dir
+                    Utils.copyFile(implant, implantcopy);
 
-            } catch (FileNotFoundException ex) {
-                throw new EnvHandlingException("Error while copying implant file to endorsed dir: file not found", ex);
-            } catch (IOException ex) {
-                throw new EnvHandlingException("Error while copying implant file to endorsed dir", ex);
+                    if (host != null || port != null) {
+                        Properties prop = new Properties();
+                        try {
+                            if (host != null) {
+                                prop.setProperty(JCovSESocketSaver.HOST_PROPERTIES_NAME, host);
+                            }
+                            if (port != null) {
+                                prop.setProperty(JCovSESocketSaver.PORT_PROPERTIES_NAME, Integer.toString(port));
+                            }
+                            prop.store(new FileOutputStream(endorsed.getAbsolutePath() + File.separator + JCovSESocketSaver.NETWORK_DEF_PROPERTIES_FILENAME), null);
+
+                        } catch (IOException ex) {
+                            logger.log(Level.WARNING, "Cannot create property file to save host and port: {0}", ex);
+                        }
+                    }
+
+
+                } catch (FileNotFoundException ex) {
+                    throw new EnvHandlingException("Error while copying implant file to endorsed dir: file not found", ex);
+                } catch (IOException ex) {
+                    throw new EnvHandlingException("Error while copying implant file to endorsed dir", ex);
+                }
+            }
+            else{
+                toInstrument = new File(toInstrument, "bootmodules.jimage");
+                if (!toInstrument.exists()) {
+                    throw new EnvHandlingException("bootmodules.jimage was not found in modules directory");
+                }
+                if (!toInstrument.isFile() || !toInstrument.canRead() || !toInstrument.canWrite()) {
+                    throw new EnvHandlingException("Can't read/write bootmodules.jimage");
+                }
+                File bak = new File(toInstrument.getParent(), "bootmodules.jimage.bak");
+                if (!bak.exists()) {
+                    try {
+                        Utils.copyFile(toInstrument, bak);
+                    } catch (FileNotFoundException ex) {
+                        throw new EnvHandlingException("Error while backuping bootmodules.jimage: file not found", ex);
+                    } catch (IOException ex) {
+                        throw new EnvHandlingException("Error while backuping bootmodules.jimage", ex);
+                    }
+                } else {
+                    if (!envHandler.isSet(Instr.DSC_SUBSEQUENT)) {
+                        throw new EnvHandlingException("Backup bootmodules.jimage.bak file exisit. It can mean that JRE is already instrumented - nothing to do. Restore initial bootmodules.jimage or delete bak file.");
+                    }
+                }
             }
         }
 
@@ -423,6 +546,7 @@
     }
     public static final OptionDescr DSC_JAVAC_HACK = new OptionDescr("javac", "hack javac", OptionDescr.VAL_SINGLE, "Hack javac to increase minimum VM memory used on initialization. Should be used on Solaris platform or should be done manually. ");
     public static final OptionDescr DCS_ADD_JAR = new OptionDescr("addjar", new String[]{"add"}, "instrument additional jars", OptionDescr.VAL_MULTI, "Instrument additional jars within JRE or JDK. Only jar files are allowed.");
+    public static final OptionDescr DCS_ADD_JIMAGE = new OptionDescr("addjimage", new String[]{"addjimage"}, "instrument additional jimages", OptionDescr.VAL_MULTI, "Instrument additional jimages within JRE or JDK. Only jimage files are allowed.");
     public static final OptionDescr DCS_ADD_TESTS = new OptionDescr("addtests", new String[]{"tests"}, "instrument tests", OptionDescr.VAL_MULTI, "Instrument tests files (classes and jars).");
     final static OptionDescr DSC_HOST =
             new OptionDescr("host", new String[]{"host"}, "sets default host", OptionDescr.VAL_SINGLE, "set the default host for sending jcov data. needed only in network mode");
--- a/src/classes/com/sun/tdk/jcov/ant/Report.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/ant/Report.java	Thu Nov 20 18:24:34 2014 +0400
@@ -29,11 +29,8 @@
 import com.sun.tdk.jcov.processing.ProcessingException;
 import com.sun.tdk.jcov.report.DefaultReportGeneratorSPI;
 import com.sun.tdk.jcov.report.ReportGeneratorSPI;
-import com.sun.tdk.jcov.report.html.CoverageReport;
-import com.sun.tdk.jcov.runtime.Collect;
+import com.sun.tdk.jcov.report.javap.JavapRepGen;
 import com.sun.tdk.jcov.runtime.PropertyFinder;
-import com.sun.tdk.jcov.tools.EnvHandler;
-import com.sun.tdk.jcov.tools.JCovTool.EnvHandlingException;
 import com.sun.tdk.jcov.util.Utils;
 import java.io.File;
 import java.io.IOException;
@@ -74,6 +71,16 @@
     public File propfile = null;
     public File filename;
     public File testlist;
+
+    public String getJavap() {
+        return javap;
+    }
+
+    public void setJavap(String javap) {
+        this.javap = javap;
+    }
+
+    public String javap;
     public boolean rewrite;
     public File fmlist;
     public LinkedList<FM> fm = new LinkedList<FM>();
@@ -163,6 +170,15 @@
             }
 
             if (filename != null) {
+
+                if (javap != null) {
+                    new JavapRepGen(repGen.getInclude(), repGen.getExclude()).run(filename.getPath(), javap, destdir.getPath());
+                    if (propfile != null) {
+                        PropertyFinder.cleanProperties();
+                    }
+                    return;
+                }
+
                 repGen.generateReport(format, destdir.getPath(), new Result(filename.getPath(), testlist != null ? testlist.getPath() : null), srcRootPath != null ? srcRootPath.getPath() : repGen.getSrcRootPath());
             } else {
                 throw new BuildException("Input jcov file needed to generate report");
--- a/src/classes/com/sun/tdk/jcov/instrument/OverriddenClassWriter.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/instrument/OverriddenClassWriter.java	Thu Nov 20 18:24:34 2014 +0400
@@ -148,11 +148,10 @@
             return loaded;
         }
         try {
-            ClassReader cr = openClassReader(clName, loader);
-
-            String superName = cr.getSuperName();
+            ClassInfo ci = getClassInfo(clName, loader);
+            String superName = ci.getSuperName();
             class_superclass.put(clName, superName);
-            detectInterfaces(clName, cr, loader);
+            detectInterfaces(clName, ci, loader);
             return superName;
         } catch (IOException e) {
             System.err.println("Failed to read class: " + clName + ". Reason: " + e.getMessage());
@@ -166,22 +165,22 @@
      * also updated to avoid multiple loading.
      *
      * @param clName
-     * @param cr
+     * @param ci
      * @throws IOException
      */
-    static void detectInterfaces(String clName, ClassReader cr, final ClassLoader loader)
+    static void detectInterfaces(String clName, ClassInfo ci, final ClassLoader loader)
             throws IOException {
         if (class_interfaces.get(clName) != null) {
             return;
         }
-        if (cr == null) {
-            cr = openClassReader(clName, loader);
-            String superName = cr.getSuperName();
+        if (ci == null) {
+            ci = getClassInfo(clName, loader);
+            String superName = ci.getSuperName();
             class_superclass.put(clName, superName);
         }
 
         ArrayList list = new ArrayList();
-        String[] interfaces = cr.getInterfaces();
+        String[] interfaces = ci.getInterfaces();
         if (interfaces != null) {
             for (String itf : interfaces) {
                 list.add(itf);
@@ -194,6 +193,7 @@
         } else {
             class_interfaces.put(clName, list);
         }
+
     }
 
     /**
@@ -206,7 +206,9 @@
      * @throws IOException when class can not be read (not found in loader or
      * can't be read by ClassReader)
      */
-    public static ClassReader openClassReader(final String clName, final ClassLoader loader) throws IOException {
+    public static ClassInfo getClassInfo(final String clName, final ClassLoader loader) throws IOException {
+
+        ClassInfo classInfo;
 
         if (loader instanceof JREInstr.StaticJREInstrClassLoader) {
             InputStream in = getInputStreamForName(clName, loader, false, ".class");
@@ -218,10 +220,22 @@
                     throw new IOException("Can't read class " + clName + " from classloader " + loader);
                 }
 
-                return new OffsetLabelingClassReader(in);
+                ClassReader cr = new OffsetLabelingClassReader(in);
+                classInfo = new ClassInfo(cr.getSuperName(), cr.getInterfaces());
+                try{
+                    in.close();
+                }
+                catch (Throwable ignore){}
+                return classInfo;
             }
 
-            return new OffsetLabelingClassReader(in);
+            ClassReader cr = new OffsetLabelingClassReader(in);
+            classInfo = new ClassInfo(cr.getSuperName(), cr.getInterfaces());
+            try{
+                in.close();
+            }
+            catch (Throwable ignore){}
+            return classInfo;
         }
 
         InputStream in = getInputStreamForName(clName, ClassLoader.getSystemClassLoader(), false, ".class");
@@ -234,7 +248,13 @@
                 if (!ClassLoader.getSystemClassLoader().equals(loader)) {
                     in = getInputStreamForName(clName, loader, false, ".class");
                     if (in != null) {
-                        return new OffsetLabelingClassReader(in);
+                        ClassReader cr = new OffsetLabelingClassReader(in);
+                        classInfo = new ClassInfo(cr.getSuperName(), cr.getInterfaces());
+                        try{
+                            in.close();
+                        }
+                        catch (Throwable ignore){}
+                        return classInfo;
                     } else {
                         throw new IOException("Can't read class " + clName + " from classloader " + loader);
                     }
@@ -245,7 +265,13 @@
 
         }
 
-        return new OffsetLabelingClassReader(in);
+        ClassReader cr = new OffsetLabelingClassReader(in);
+        classInfo = new ClassInfo(cr.getSuperName(), cr.getInterfaces());
+        try{
+            in.close();
+        }
+        catch (Throwable ignore){}
+        return classInfo;
     }
 
     /**
@@ -285,4 +311,23 @@
 
         return null;
     }
+
+    private static class ClassInfo{
+        String superName;
+        String[] interfaces;
+
+        ClassInfo(String superName, String[] interfaces){
+            this.superName = superName;
+            this.interfaces = interfaces;
+        }
+
+        public String getSuperName(){
+            return superName;
+        }
+
+        public String[] getInterfaces(){
+            return interfaces;
+        }
+
+    }
 }
--- a/src/classes/com/sun/tdk/jcov/report/html/resources/style.css	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/report/html/resources/style.css	Thu Nov 20 18:24:34 2014 +0400
@@ -23,7 +23,7 @@
  * questions.
  */
 body {
-	font-family: verdana, arial, sans-serif
+	font-family: verdana, arial, sans-serif;
 	font-size: 12px;
 }
 
--- a/src/classes/com/sun/tdk/jcov/report/javap/JavapClass.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/report/javap/JavapClass.java	Thu Nov 20 18:24:34 2014 +0400
@@ -166,6 +166,9 @@
         textLine = textLine + "{";
 
         className = substringBetween(textLine, "\\.", "\\ ", false);
+        if(className != null && className.contains("<") && className.contains(">")){
+            className = className.substring(0, className.indexOf('<'));
+        }
 
     }
 
--- a/src/classes/com/sun/tdk/jcov/report/javap/JavapRepGen.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/report/javap/JavapRepGen.java	Thu Nov 20 18:24:34 2014 +0400
@@ -38,10 +38,7 @@
 import com.sun.tdk.jcov.util.Utils;
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.logging.Level;
@@ -202,7 +199,7 @@
         }
 
         RepGen rg = new RepGen();
-        rg.configure(null, null, null, null, false, false, false, false, false, false, false, false);
+        rg.configure(include, exclude, null, null, false, false, false, false, false, false, false, false);
 
         try {
             Result res = new Result(templatePath);
@@ -218,16 +215,17 @@
         ArrayList<File> newFiles = new ArrayList<File>();
         if (files.size() > 1) {
 
+            classesPath = new File(classesPath+"/").getAbsolutePath().replaceAll("\\\\","/");
             for (File classFile : files) {
 
-                String className = classFile.getAbsolutePath();
-                if (classFile.getAbsolutePath().startsWith(classesPath + File.separator)){
+                String className = classFile.getAbsolutePath().replaceAll("\\\\","/");
+
+                if (className.startsWith(classesPath + "/")){
                     className = className.substring(classesPath.length()+1);
                 }
                 if (className.endsWith(".class")) {
                     className = className.substring(0, className.lastIndexOf(".class"));
                 }
-
                 if (Utils.accept(Utils.concatFilters(include, exclude), null, "/" + className, null)) {
                     newFiles.add(classFile);
                 }
--- a/src/classes/com/sun/tdk/jcov/runtime/Collect.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/runtime/Collect.java	Thu Nov 20 18:24:34 2014 +0400
@@ -38,7 +38,7 @@
 public class Collect {
 
     // coverage data
-    public static final int MAX_SLOTS = 1100000;
+    public static final int MAX_SLOTS = 1200000;
     public static int SLOTS = MAX_SLOTS;
     private static final int MAX_SAVERS = 10;
     private static int nextSlot = 0;
--- a/src/classes/com/sun/tdk/jcov/runtime/JCovSESocketSaver.java	Mon Oct 13 20:44:43 2014 +0400
+++ b/src/classes/com/sun/tdk/jcov/runtime/JCovSESocketSaver.java	Thu Nov 20 18:24:34 2014 +0400
@@ -45,14 +45,14 @@
     static {
 
         File file = null;
-
+        String urlString = "";
         try {
-            String urlString = ClassLoader.getSystemClassLoader().getResource(JCovSESocketSaver.class.getCanonicalName().replaceAll("\\.", "/") + ".class").toString();
+            urlString = ClassLoader.getSystemClassLoader().getResource(JCovSESocketSaver.class.getCanonicalName().replaceAll("\\.", "/") + ".class").toString();
             urlString = urlString.substring(urlString.indexOf("file:"), urlString.indexOf('!'));
             URL url = new URL(urlString);
             file = new File(url.toURI());
         } catch (Exception e) {
-            System.err.println("Error while finding " + NETWORK_DEF_PROPERTIES_FILENAME + " file: " + e);
+            System.err.println("Error while finding " + urlString + " file: " + e);
         }
 
         if (file != null && file.exists()) {