From 4c9e62c6e3513a57e86dfb7ea06a74ce2943aaaa Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Sep 2012 13:41:02 +0200 Subject: Java cleanup, convert ArrayList and Vector to use generics Change-Id: Ic668b46872ee0bfd259ca335aed9d68fb545c3a4 --- .../mediawiki/src/com/sun/star/wiki/Settings.java | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'swext') diff --git a/swext/mediawiki/src/com/sun/star/wiki/Settings.java b/swext/mediawiki/src/com/sun/star/wiki/Settings.java index 7c96d4c7b532..87cc378b88ad 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Settings.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Settings.java @@ -42,8 +42,8 @@ public class Settings private static Settings m_instance; - private Vector m_WikiConnections = new Vector(); - private Vector m_aWikiDocs = new Vector(); + private Vector> m_WikiConnections = new Vector>(); + private Vector> m_aWikiDocs = new Vector>(); private Settings( XComponentContext ctx ) { @@ -61,13 +61,13 @@ public class Settings } - public void addWikiCon ( Hashtable wikiCon ) + public void addWikiCon ( Hashtable wikiCon ) { m_WikiConnections.add( wikiCon ); } - public Vector getWikiCons() + public Vector> getWikiCons() { return m_WikiConnections; } @@ -77,14 +77,14 @@ public class Settings String url = ""; if ( num >=0 && num < m_WikiConnections.size() ) { - Hashtable ht = ( Hashtable ) m_WikiConnections.get( num ); + Hashtable ht = m_WikiConnections.get( num ); url = ( String ) ht.get( "Url" ); } return url; } - public void addWikiDoc ( Hashtable aWikiDoc ) + public void addWikiDoc ( Hashtable aWikiDoc ) { String sURL = ( String ) aWikiDoc.get( "CompleteUrl" ); Hashtable aEntry = getDocByCompleteUrl( sURL ); @@ -104,7 +104,7 @@ public class Settings } - public Vector getWikiDocs() + public Vector> getWikiDocs() { return m_aWikiDocs; } @@ -112,11 +112,11 @@ public class Settings public Object[] getWikiDocList( int serverid, int num ) { String wikiserverurl = getWikiConUrlByNumber( serverid ); - Vector theDocs = new Vector(); + Vector theDocs = new Vector(); String [] docs = new String[0]; for ( int i=0; i getSettingByUrl( String sUrl ) { - Hashtable ht = null; + Hashtable ht = null; for( int i=0;i h1 = m_WikiConnections.get( i ); + String u1 = h1.get( "Url" ); if ( u1.equals( sUrl ) ) { ht = h1; try { - String sUserName = (String)ht.get( "Username" ); - String aPassword = (String)ht.get( "Password" ); + String sUserName = ht.get( "Username" ); + String aPassword = ht.get( "Password" ); if ( sUserName != null && sUserName.length() > 0 && ( aPassword == null || aPassword.length() == 0 ) ) { String[] pPasswords = Helper.GetPasswordsForURLAndUser( m_xContext, sUrl, sUserName ); @@ -185,7 +185,7 @@ public class Settings Hashtable ht = null; for( int i=0;i ht = new Hashtable(); ht.put( "Url", allCons[i] ); ht.put( "Username", "" ); ht.put( "Password", "" ); try { - XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, xConnectionList.getByName( allCons[i] ) ); + XPropertySet xProps = UnoRuntime.queryInterface( XPropertySet.class, xConnectionList.getByName( allCons[i] ) ); if ( xProps != null ) { String aUsername = AnyConverter.toString( xProps.getPropertyValue( "UserName" ) ); @@ -316,13 +316,13 @@ public class Settings } Object oDocs = xAccess.getByName( "RecentDocs" ); - XNameAccess xRecentDocs = ( XNameAccess ) UnoRuntime.queryInterface( XNameAccess.class, oDocs ); + XNameAccess xRecentDocs = UnoRuntime.queryInterface( XNameAccess.class, oDocs ); String [] allDocs = xRecentDocs.getElementNames(); for ( int i=0; i ht = new Hashtable(); ht.put( "Url", xDoc.getByName( "Url" ) ); ht.put( "CompleteUrl", xDoc.getByName( "CompleteUrl" ) ); ht.put( "Doc", xDoc.getByName( "Doc" ) ); -- cgit v1.2.3