Bug 547265 - Fine-grained access to system properties in launcher's Main

Running with SecurityManager enabled, System.getProperties() requires
full access to all properties, including write permission, even if we
are not going to modify any of them. Instead, replace
System.getProperties().xxx() chained calls with their direct
counterparts:

- System.getProperties().getProperty() with System.getProperty()
- System.getProperties().put() with System.setProperty()
- System.getProperties().remove() with System.clearProperty()

This would allow to use minimal security policy regarding system
properties like:

    grant {
      permission java.util.PropertyPermission "*", "read";
      permission java.util.PropertyPermission "osgi.*", "write";
      permission java.util.PropertyPermission "eclipse.*", "write";
    };

and would provide more specific error message if/when
AccessControlException occurs:

    java.security.AccessControlException: access denied ("java.util.PropertyPermission" "eclipse.exitcode" "read")

Change-Id: If5d4cb0dc8ad795d1a9c85932222072bd58121ce
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
3 files changed