Skip to main content

System property to turn Quick Start Wizard off

11 replies [Last post]
sergey_borodin
Offline
Joined: 2006-10-20

Hi all,
I prepared ability to turn Quick Start Wizard dialog off, and corresponding File menu item, as this component has number of bugs and may confuse some users.

To turn it off, you need to set "com.sun.javatest.qsw" java system property to "off" value:
-Dcom.sun.javatest.qsw=off

Changeset is:
https://jtharness.dev.java.net/source/browse/jtharness?rev=1030&view=rev

Thanks,
Sergey Borodin

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sergey_borodin
Offline
Joined: 2006-10-20

changed property name to "com.sun.javatest.qswDisabled". Now we can use Boolean.parseBoolean(), and, if "true" value to use, means we disable QSW.
Package private static boolean qswDisabled added.

Changes are:
https://jtharness.dev.java.net/source/browse/jtharness?rev=1079&view=rev

Thanks,
Sergey

bkurotsu
Offline
Joined: 2004-12-13

Why package private? I suggest going full private and using an accessor method. The usage of it is just as simple.

if ( QuickStartWizard.isQswDisabled() ) {

sergey_borodin
Offline
Joined: 2006-10-20
bkurotsu
Offline
Joined: 2004-12-13

Ha ha. Discussion continues...

Do you think it is necessary to lookup the property every time the method is queried, or cache the result from the first time?

bernhasc
Offline
Joined: 2008-11-11

in QuickStartWizard.java:
< static boolean qswDisabled = Boolean.parseBoolean(
< System.getProperty(QSW_OFF_PROPERTY));
caches the value nicely.... But, isn't this value unchangeable? why not make it final?

bkurotsu mentioned creating an accessor method...which ya did, but ...
> static boolean isQswDisabled() {
> return Boolean.parseBoolean(System.getProperty(QSW_OFF_PROPERTY));
> }

Hitting System for a property that wont change, then parsing a w_char string every time? both calls are slugs. Why not (along w/ the above "final" chg) :
public static boolean isQswDisabled() { return qswDisabled; }

Message was edited by: bernhasc

bkurotsu
Offline
Joined: 2004-12-13

Agree, cache the value is better.

sergey_borodin
Offline
Joined: 2006-10-20
bkurotsu
Offline
Joined: 2004-12-13

Sergey,

My main comment is that I think this property should be changed to a true/false. This makes it consistent with existing system properties that we use for similar purposes, and you can use a library to parse it instead of doing the comparison yourself - Boolean.getBoolean("").

Other than that, I just think we need to carefully test the various startup scenarios to make sure there are no side effects.

Brian

sergey_borodin
Offline
Joined: 2006-10-20

I changed acceptable value to "true"/"false", but it doesn't allow us to use Boolean.getBoolean() in any case, because it:

"Returns true if and only if the system property named by the argument exists and is equal to the string "true". "

This means user need to specify system property with "true" value, if he doesn't want to turn it off, while we need "true" as default.

change set:
https://jtharness.dev.java.net/source/browse/jtharness?rev=1052&view=rev

Thanks,
Sergey Borodin

bkurotsu
Offline
Joined: 2004-12-13

Hum, not quite what I was thinking. And I misspoke, I meant Boolean.parseBoolean(String).

How about a package private static value in QuickStartWizard?

static boolean qswEnabled = Boolean.parseBoolean(System.getProperty(...)));

So when you check it, it's just
if (QuickStartWizard.qswEnabled)
addMenu(...)

Brian

bkurotsu
Offline
Joined: 2004-12-13

Also, the property name you chose doesn't leave us extra namespace in the QSW area. How about
com.sun.javatest.qswEnabled instead?