Details
-
Bug
-
Resolution: Fixed
-
P1
-
8
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8031400 | 9 | Erik Joelsson | P1 | Resolved | Fixed | b01 |
JDK-8032079 | 8u20 | Erik Joelsson | P1 | Closed | Fixed | b01 |
JDK-8032403 | 8u5 | Erik Joelsson | P1 | Resolved | Fixed | b05 |
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 ----------
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
- backported by
-
JDK-8031400 System.setProperties(null) drops all system properties (RELEASE not set)
- Resolved
-
JDK-8032403 System.setProperties(null) drops all system properties (RELEASE not set)
- Resolved
-
JDK-8032079 System.setProperties(null) drops all system properties (RELEASE not set)
- Closed
- relates to
-
JDK-8022854 System.setProperties(null) does not remove implementation properties
- Open
-
JDK-8031388 (props) Add comprehensive test for System.setProperties(null)
- Open