Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8030781

System.setProperties(null) drops all system properties (RELEASE not set)

    XMLWordPrintable

Details

    • b74
    • 8
    • b124
    • generic
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.8.0-ea"
        Java(TM) SE Runtime Environment (build 1.8.0-ea-b120)
        Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Darwin Kernel Version 13.0.1: Thu Sep 19 19:30:57 PDT 2013; root:xnu-2422.50.20~2/RELEASE_X86_64 x86_64

        A DESCRIPTION OF THE PROBLEM :
        The following test case works on 1.7, passed on ea-b120:

        public class TinyTest extends TestCase {
            public void testSetProperties(){
                final String version = System.getProperty("java.version");
                System.setProperties(null);
                assertEquals( version, System.getProperty("java.version"));
            }
        }



        REGRESSION. Last worked in version 7u45

        ACTUAL -
        The second call to getProperty returns an empty string ("")

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------

        public class TinyTest extends TestCase {
            public void testSetProperties(){
                final String version = System.getProperty("java.version");
                System.setProperties(null);
                assertEquals( version, System.getProperty("java.version"));
            }
        }
        ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

                erikj Erik Joelsson
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: