[jitsi-dev] [patch] Parallel DNS configuration form


#1

Hey

Ingo is also going to implement a patch that allows users to disable DNS
fallback entirely if they choose to.

Attached is the promised advanced configuration form. There are some points left open where I'd like to have your comments:
- All the DNS properties are now loaded/saved through the ConfigService and are no longer System properties
- The util bundle now exports the dns package to so I can get access to the property fields. I find this suboptimal as it provides access to the ParallelResolver in general which is not the intention
- To get access to the default DNS port in the SimpleResolver class, I crated a method that export this field to avoid the export of dnsjava from util
- Properties in general: what is the intention of defaults.properties? I find it confusing to have some config defaults in this file and but most of the default hardcoded

Let me know what needs to be changed.

Regards,
Ingo

parallel_dns_config.patch (38 KB)


#2

Hi Ingo,

I've just committed and acked your patch on our team and contribution
page. Thanks for your work.

I just made some minor changes in your patch:
- there was an exception:
     [java] java.lang.ClassCastException: java.lang.Long cannot be
cast to java.lang.Integer
     [java] at java.lang.Integer.compareTo(Integer.java:37)
     [java] at
javax.swing.SpinnerNumberModel.incrValue(SpinnerNumberModel.java:332)
     [java] at
javax.swing.SpinnerNumberModel.getPreviousValue(SpinnerNumberModel.java:371)
     [java] at
javax.swing.plaf.basic.BasicSpinnerUI.updateEnabledState(BasicSpinnerUI.java:489)
     [java] at
javax.swing.plaf.basic.BasicSpinnerUI.updateEnabledState(BasicSpinnerUI.java:470)
     [java] at
javax.swing.plaf.basic.BasicSpinnerUI.access$200(BasicSpinnerUI.java:33)
     [java] at
javax.swing.plaf.basic.BasicSpinnerUI$Handler.stateChanged(BasicSpinnerUI.java:1047)
     [java] at javax.swing.JSpinner.fireStateChanged(JSpinner.java:434)
     [java] at
javax.swing.JSpinner$ModelListener.stateChanged(JSpinner.java:361)
     [java] at
javax.swing.AbstractSpinnerModel.fireStateChanged(AbstractSpinnerModel.java:102)
     [java] at
javax.swing.SpinnerNumberModel.setValue(SpinnerNumberModel.java:430)
     [java] at javax.swing.JSpinner.setValue(JSpinner.java:329)
     [java] at
net.java.sip.communicator.plugin.dnsconfig.DnsConfigPanel.loadData(DnsConfigPanel.java:322)
     [java] at
net.java.sip.communicator.plugin.dnsconfig.DnsConfigPanel.<init>(DnsConfigPanel.java:59)

As the value was a delay and is supposed to be a not so long I made it int.

- In the config panel there was a java 1.6 only class
javax.swing.GroupLayout I removed it and made the form look like the
other advance config forms, check it out :slight_smile:

- Little modifications on the code style there were a lot of packages
in the code like javax.swing.JLabel (not in the imports), maybe its
your ide that insert them but we prefer to simplify the code for easy
reading and avoid this. Also there were some code over the 80 column.
Most of these was only in the class DnsConfigPanel and also the
implements/extends and throw clauses in the class and method
declarations.

- Some string improvementс.

- And I move setting the resolver to the lookup into the synchronized
block (as it was) to avoid using the resolver during resetting it,
this happens mostly when network has change its connected state.

Thanks
damencho