-
Bug
-
Resolution: Fixed
-
P3
-
7
-
None
-
b133
-
generic
-
generic
-
Verified
Invalid parameters passed in ClientJVMSelectionParameters.extract(Map) causes silent applet start failure.
Say we have the following unittest:
====================================
public void testExtractWithMalformedHeapsizeValues() {
Map<String,String> parameters = new HashMap<String,String>();
final ClientJVMSelectionParameters defaultInstance =
ClientJVMSelectionParameters.getDefault();
parameters.put(ParameterNames.SEPARATE_JVM, "true");
parameters.put(ParameterNames.REQUIRED_JVM_HEAP, "k1000");
parameters.put(ParameterNames.FX_VERSION, "2.2+");
ClientJVMSelectionParameters extractedInstance =
ClientJVMSelectionParameters.extract(parameters);
assertTrue("SEPARATE_JVM should have been set",
extractedInstance.isSeparateJVM());
assertEquals("availableHeapSize should have default value",
defaultInstance.getAvailableHeapSize(), extractedInstance.getAvailableHeapSize());
assertEquals("jfx requirement should have been set",
new VersionID("2.2+"), extractedInstance.getJfxRequirement());
}
====================================
The tset result will be:
====================================
Testcase: testExtractWithMalformedHeapsizeValues(sun.plugin2.main.server.ClientJVMSelectionParametersTest): Caused an ERROR
Too many characters after heap size specifier
java.lang.IllegalArgumentException: Too many characters after heap size specifier
at com.sun.deploy.util.JVMParameters.parseMemorySpec(Unknown Source)
at sun.plugin2.main.server.ClientJVMSelectionParameters.extract(Unknown Source)
at sun.plugin2.main.server.ClientJVMSelectionParametersTest.testExtractWithMalformedHeapsizeValues(ClientJVMSelectionParametersTest.java:128)
at sun.tests.junit.DeployTestCase.runBare(Unknown Source)
====================================
which means that this causes error in server JVM and the client has no knowledge with it. Hence the silent applet start failure.
Say we have the following unittest:
====================================
public void testExtractWithMalformedHeapsizeValues() {
Map<String,String> parameters = new HashMap<String,String>();
final ClientJVMSelectionParameters defaultInstance =
ClientJVMSelectionParameters.getDefault();
parameters.put(ParameterNames.SEPARATE_JVM, "true");
parameters.put(ParameterNames.REQUIRED_JVM_HEAP, "k1000");
parameters.put(ParameterNames.FX_VERSION, "2.2+");
ClientJVMSelectionParameters extractedInstance =
ClientJVMSelectionParameters.extract(parameters);
assertTrue("SEPARATE_JVM should have been set",
extractedInstance.isSeparateJVM());
assertEquals("availableHeapSize should have default value",
defaultInstance.getAvailableHeapSize(), extractedInstance.getAvailableHeapSize());
assertEquals("jfx requirement should have been set",
new VersionID("2.2+"), extractedInstance.getJfxRequirement());
}
====================================
The tset result will be:
====================================
Testcase: testExtractWithMalformedHeapsizeValues(sun.plugin2.main.server.ClientJVMSelectionParametersTest): Caused an ERROR
Too many characters after heap size specifier
java.lang.IllegalArgumentException: Too many characters after heap size specifier
at com.sun.deploy.util.JVMParameters.parseMemorySpec(Unknown Source)
at sun.plugin2.main.server.ClientJVMSelectionParameters.extract(Unknown Source)
at sun.plugin2.main.server.ClientJVMSelectionParametersTest.testExtractWithMalformedHeapsizeValues(ClientJVMSelectionParametersTest.java:128)
at sun.tests.junit.DeployTestCase.runBare(Unknown Source)
====================================
which means that this causes error in server JVM and the client has no knowledge with it. Hence the silent applet start failure.