[sip-comm-dev] Re: svn commit: r5294 - SIPAccountRegistrationWizard.java


#1

Hey Werner,

The build tests were failing these days because of problems with our
openfire installation which probably makes it difficult to spot compile
time failures so I am pinging you here.

I am afraid your latest commit introduces use
java.util.AbstractMap.SimpleEntry which is only available (i.e. public)
in 1.6. This causes cruisecontrol compilation as well as building on
standard Mac OS X environments to fail.

Think you could have a look?

Cheers
Emil

wernerd@dev.java.net wrote:

···

Author: wernerd
Date: 2009-04-26 08:55:03+0000
New Revision: 5294

Modified:
   trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java

Log:
Replace Hashtable with ArrayList and Map entries in getSummary. This keeps the intended order also
on the summary page.

Modified: trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java?view=diff&rev=5294&p1=trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java&p2=trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java&r1=5293&r2=5294

--- trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java 2009-04-26 08:55:03+0000
@@ -110,100 +110,100 @@
      */
     public Iterator<Map.Entry<String, String>> getSummary()
     {
- Map<String, String> summaryTable = new Hashtable<String, String>();
+ ArrayList<Map.Entry<String, String>> summaryTable = new ArrayList<Map.Entry<String, String>>();
         boolean rememberPswd = registration.isRememberPassword();
         String rememberPswdString = Resources.getString(
                 rememberPswd ? "service.gui.YES" : "service.gui.NO");

- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.USERNAME"),
- registration.getId());
- summaryTable.put(
+ registration.getId()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("service.gui.REMEMBER_PASSWORD"),
- rememberPswdString);
- summaryTable.put(
+ rememberPswdString));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.REGISTRAR"),
- registration.getServerAddress());
- summaryTable.put(
+ registration.getServerAddress()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.SERVER_PORT"),
- registration.getServerPort());
- summaryTable.put(
+ registration.getServerPort()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.PROXY"),
- registration.getProxy());
- summaryTable.put(
+ registration.getProxy()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.PROXY_PORT"),
- registration.getProxyPort());
- summaryTable.put(
+ registration.getProxyPort()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.PREFERRED_TRANSPORT"),
- registration.getPreferredTransport());
+ registration.getPreferredTransport()));

         if (registration.isEnablePresence())
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.ENABLE_PRESENCE"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.ENABLE_PRESENCE"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

         if (registration.isForceP2PMode())
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.FORCE_P2P_PRESENCE"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.FORCE_P2P_PRESENCE"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

         if (registration.isDefaultEncryption())
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_DEFAULT_ENCRYPTION"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_DEFAULT_ENCRYPTION"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

         if (registration.isSipZrtpAttribute())
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_SIPZRTP_ATTRIBUTE"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_SIPZRTP_ATTRIBUTE"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.OFFLINE_CONTACT_POLLING_PERIOD"),
- registration.getPollingPeriod());
- summaryTable.put(Resources.getString(
+ registration.getPollingPeriod()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.SUBSCRIPTION_EXPIRATION"),
- registration.getSubscriptionExpiration());
+ registration.getSubscriptionExpiration()));

- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.KEEP_ALIVE_METHOD"),
- registration.getKeepAliveMethod());
- summaryTable.put(
+ registration.getKeepAliveMethod()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.KEEP_ALIVE_INTERVAL"),
- registration.getKeepAliveInterval());
+ registration.getKeepAliveInterval()));

- return summaryTable.entrySet().iterator();
+ return summaryTable.iterator();
     }

     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Sure. I discarded Java 5 some time ago :slight_smile:

Regards,
Werner

Emil Ivov schrieb:

···

Hey Werner,

The build tests were failing these days because of problems with our
openfire installation which probably makes it difficult to spot compile
time failures so I am pinging you here.

I am afraid your latest commit introduces use
java.util.AbstractMap.SimpleEntry which is only available (i.e. public)
in 1.6. This causes cruisecontrol compilation as well as building on
standard Mac OS X environments to fail.

Think you could have a look?

Cheers
Emil

wernerd@dev.java.net wrote:

Author: wernerd
Date: 2009-04-26 08:55:03+0000
New Revision: 5294

Modified:
   trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java

Log:
Replace Hashtable with ArrayList and Map entries in getSummary. This keeps the intended order also
on the summary page.

Modified: trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java?view=diff&rev=5294&p1=trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java&p2=trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java&r1=5293&r2=5294

--- trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java 2009-04-26 08:55:03+0000
@@ -110,100 +110,100 @@
      */
     public Iterator<Map.Entry<String, String>> getSummary()
     {
- Map<String, String> summaryTable = new Hashtable<String, String>();
+ ArrayList<Map.Entry<String, String>> summaryTable = new ArrayList<Map.Entry<String, String>>();
         boolean rememberPswd = registration.isRememberPassword();
         String rememberPswdString = Resources.getString(
                 rememberPswd ? "service.gui.YES" : "service.gui.NO");

- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.USERNAME"),
- registration.getId());
- summaryTable.put(
+ registration.getId()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("service.gui.REMEMBER_PASSWORD"),
- rememberPswdString);
- summaryTable.put(
+ rememberPswdString));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.REGISTRAR"),
- registration.getServerAddress());
- summaryTable.put(
+ registration.getServerAddress()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.SERVER_PORT"),
- registration.getServerPort());
- summaryTable.put(
+ registration.getServerPort()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.PROXY"),
- registration.getProxy());
- summaryTable.put(
+ registration.getProxy()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.PROXY_PORT"),
- registration.getProxyPort());
- summaryTable.put(
+ registration.getProxyPort()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.PREFERRED_TRANSPORT"),
- registration.getPreferredTransport());
+ registration.getPreferredTransport()));

         if (registration.isEnablePresence())
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.ENABLE_PRESENCE"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.ENABLE_PRESENCE"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

         if (registration.isForceP2PMode())
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.FORCE_P2P_PRESENCE"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
                 Resources.getString("plugin.sipaccregwizz.FORCE_P2P_PRESENCE"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

         if (registration.isDefaultEncryption())
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_DEFAULT_ENCRYPTION"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_DEFAULT_ENCRYPTION"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

         if (registration.isSipZrtpAttribute())
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_SIPZRTP_ATTRIBUTE"),
- Resources.getString("service.gui.YES"));
+ Resources.getString("service.gui.YES")));
         }
         else
         {
- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.ENABLE_SIPZRTP_ATTRIBUTE"),
- Resources.getString("service.gui.NO"));
+ Resources.getString("service.gui.NO")));
         }

- summaryTable.put(Resources.getString(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.OFFLINE_CONTACT_POLLING_PERIOD"),
- registration.getPollingPeriod());
- summaryTable.put(Resources.getString(
+ registration.getPollingPeriod()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(Resources.getString(
                 "plugin.sipaccregwizz.SUBSCRIPTION_EXPIRATION"),
- registration.getSubscriptionExpiration());
+ registration.getSubscriptionExpiration()));

- summaryTable.put(
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.KEEP_ALIVE_METHOD"),
- registration.getKeepAliveMethod());
- summaryTable.put(
+ registration.getKeepAliveMethod()));
+ summaryTable.add(new AbstractMap.SimpleEntry<String, String>(
             Resources.getString("plugin.sipaccregwizz.KEEP_ALIVE_INTERVAL"),
- registration.getKeepAliveInterval());
+ registration.getKeepAliveInterval()));

- return summaryTable.entrySet().iterator();
+ return summaryTable.iterator();
     }

     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Emil,

done. Modifications checked in and should work with Java 5.
I've copied an implementation of a Map.Entry implementation
from GNU classpath in the SIPAccountRegsitrationWizard. If required
this could be made a public class in some utility package.

Regards,
Werner

"Use the source, Luke" :wink:

Werner Dittmann schrieb:

···

Sure. I discarded Java 5 some time ago :slight_smile:

Regards,
Werner

Emil Ivov schrieb:

Hey Werner,

The build tests were failing these days because of problems with our
openfire installation which probably makes it difficult to spot compile
time failures so I am pinging you here.

I am afraid your latest commit introduces use
java.util.AbstractMap.SimpleEntry which is only available (i.e. public)
in 1.6. This causes cruisecontrol compilation as well as building on
standard Mac OS X environments to fail.

Think you could have a look?

Cheers
Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net