[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] [generics] Patch: FYI: generics cleanups
From: |
Tom Tromey |
Subject: |
[cp-patches] [generics] Patch: FYI: generics cleanups |
Date: |
29 Nov 2005 07:29:42 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
I'm checking this in on the generics branch.
This genericizes a few methods I missed during the previous patches.
I think for API genericization all that remains now is javax.imageio
(I have a patch for this) and a few methods in java.util.
Tom
2005-11-29 Tom Tromey <address@hidden>
* javax/swing/text/StyleContext.java (removeAttributes): Genericized.
(getAttributeNames): Likewise.
* javax/swing/text/SimpleAttributeSet.java (getAttributeNames):
Genericized.
(removeAttributes): Likewise.
* javax/swing/text/DefaultStyledDocument.java (getStyleNames):
Genericized.
* javax/swing/text/AbstractDocument.java (getAttributeNames):
Genericized.
(removeAttributes): Likewise.
* javax/swing/table/TableColumnModel.java (getColumns): Genericized.
* javax/swing/table/AbstractTableModel.java (getColumnClass):
Genericized.
* javax/swing/tree/VariableHeightLayoutCache.java
(getVisiblePathsFrom): Genericized.
* javax/swing/tree/FixedHeightLayoutCache.java (getVisiblePathsFrom):
Genericized.
* javax/swing/undo/StateEdit.java (postState): Genericized.
(preState): Likewise.
* javax/security/sasl/SaslServerFactory.java (createSaslServer):
Genericized.
* javax/security/sasl/SaslClientFactory.java (createSaslClient):
Genericized.
(getMechanismNames): Likewise.
* javax/security/sasl/Sasl.java (createSaslClient): Genericized.
(createSaslServer): Likewise.
(getSaslClientFactories): Likewise.
(getSaslServerFactories): Likewise.
* javax/security/auth/spi/LoginModule.java (initialize): Genericized.
* javax/security/auth/login/AppConfigurationEntry.java
(AppConfigurationEntry): Genericized.
(getOptions): Likewise.
* javax/sql/RowSet.java (getTypeMap): Genericized.
(setTypeMap): Likewise.
* java/sql/Array.java (getResultSet): Genericized.
* java/security/cert/X509CertSelector.java (getExtendedKeyUsage):
Genericized.
* java/security/Permissions.java (elements): Genericized.
* java/rmi/server/RMIClassLoader.java (loadClass): Genericized.
Index: java/rmi/server/RMIClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/rmi/server/RMIClassLoader.java,v
retrieving revision 1.10.2.5
diff -u -r1.10.2.5 RMIClassLoader.java
--- java/rmi/server/RMIClassLoader.java 25 Nov 2005 22:50:47 -0000 1.10.2.5
+++ java/rmi/server/RMIClassLoader.java 29 Nov 2005 14:29:25 -0000
@@ -102,7 +102,7 @@
* @throws MalformedURLException if the URL is not well formed
* @throws ClassNotFoundException if the requested class cannot be found
*/
- public static Class loadClass(URL codeBase, String name)
+ public static Class<?> loadClass(URL codeBase, String name)
throws MalformedURLException, ClassNotFoundException
{
RMIClassLoaderSpi spi = getProviderInstance();
Index: java/security/Permissions.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/security/Permissions.java,v
retrieving revision 1.7.2.5
diff -u -r1.7.2.5 Permissions.java
--- java/security/Permissions.java 2 Aug 2005 20:12:25 -0000 1.7.2.5
+++ java/security/Permissions.java 29 Nov 2005 14:29:25 -0000
@@ -150,7 +150,7 @@
*
* @return an <code>Enumeration</code> of this collection's elements
*/
- public Enumeration elements()
+ public Enumeration<Permission> elements()
{
return new Enumeration()
{
Index: java/security/cert/X509CertSelector.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/java/security/cert/X509CertSelector.java,v
retrieving revision 1.4.2.5
diff -u -r1.4.2.5 X509CertSelector.java
--- java/security/cert/X509CertSelector.java 25 Nov 2005 22:18:19 -0000
1.4.2.5
+++ java/security/cert/X509CertSelector.java 29 Nov 2005 14:29:25 -0000
@@ -574,7 +574,7 @@
*
* @return The set of key purpose OIDs (strings).
*/
- public Set getExtendedKeyUsage()
+ public Set<String> getExtendedKeyUsage()
{
if (keyPurposeSet != null)
return Collections.unmodifiableSet(keyPurposeSet);
Index: java/sql/Array.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/sql/Array.java,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 Array.java
--- java/sql/Array.java 27 Nov 2005 15:24:16 -0000 1.7.2.2
+++ java/sql/Array.java 29 Nov 2005 14:29:25 -0000
@@ -181,6 +181,6 @@
* @exception SQLException If an error occurs.
* @see ResultSet
*/
- ResultSet getResultSet(long index, int count, Map map)
+ ResultSet getResultSet(long index, int count, Map<String, Class<?>> map)
throws SQLException;
}
Index: javax/security/auth/login/AppConfigurationEntry.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/security/auth/login/AppConfigurationEntry.java,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 AppConfigurationEntry.java
--- javax/security/auth/login/AppConfigurationEntry.java 2 Aug 2005
20:12:36 -0000 1.1.2.2
+++ javax/security/auth/login/AppConfigurationEntry.java 29 Nov 2005
14:29:27 -0000
@@ -57,7 +57,7 @@
public AppConfigurationEntry (final String loginModuleName,
final LoginModuleControlFlag controlFlag,
- final Map options)
+ final Map<String, ?> options)
{
if (loginModuleName == null || loginModuleName.length() == 0)
throw new IllegalArgumentException ("module name cannot be null nor
empty");
@@ -86,7 +86,7 @@
return loginModuleName;
}
- public Map getOptions()
+ public Map<String, ?> getOptions()
{
return options;
}
Index: javax/security/auth/spi/LoginModule.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/security/auth/spi/LoginModule.java,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 LoginModule.java
--- javax/security/auth/spi/LoginModule.java 2 Aug 2005 20:12:36 -0000
1.1.2.2
+++ javax/security/auth/spi/LoginModule.java 29 Nov 2005 14:29:27 -0000
@@ -95,7 +95,7 @@
* @param options A mapping of options given to this module.
*/
void initialize(Subject subject, CallbackHandler handler,
- Map sharedState, Map options);
+ Map<String, ?> sharedState, Map<String, ?> options);
/**
* Authenticates a subject to the system. This is the primary
Index: javax/security/sasl/Sasl.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/security/sasl/Sasl.java,v
retrieving revision 1.3.2.5
diff -u -r1.3.2.5 Sasl.java
--- javax/security/sasl/Sasl.java 2 Nov 2005 00:43:41 -0000 1.3.2.5
+++ javax/security/sasl/Sasl.java 29 Nov 2005 14:29:28 -0000
@@ -356,7 +356,8 @@
public static SaslClient createSaslClient(String[] mechanisms,
String authorizationID,
String protocol,
- String serverName, Map props,
+ String serverName,
+ Map<String, ?> props,
CallbackHandler cbh)
throws SaslException
{
@@ -444,7 +445,7 @@
* address@hidden SaslClient} instance.
* @see #createSaslClient(String[],String,String,String,Map,CallbackHandler)
*/
- public static Enumeration getSaslClientFactories()
+ public static Enumeration<SaslClientFactory> getSaslClientFactories()
{
Vector result = new Vector();
HashSet names = new HashSet();
@@ -559,7 +560,8 @@
*/
public static SaslServer createSaslServer(String mechanism, String protocol,
String serverName,
- Map props, CallbackHandler cbh)
+ Map<String, ?> props,
+ CallbackHandler cbh)
throws SaslException
{
if (mechanism == null)
@@ -636,7 +638,7 @@
* address@hidden SaslServer} instance.
* @see #createSaslServer(String,String,String,Map,CallbackHandler)
*/
- public static Enumeration getSaslServerFactories()
+ public static Enumeration<SaslServerFactory> getSaslServerFactories()
{
Vector result = new Vector();
HashSet names = new HashSet();
Index: javax/security/sasl/SaslClientFactory.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/security/sasl/SaslClientFactory.java,v
retrieving revision 1.3.2.4
diff -u -r1.3.2.4 SaslClientFactory.java
--- javax/security/sasl/SaslClientFactory.java 2 Nov 2005 00:43:41 -0000
1.3.2.4
+++ javax/security/sasl/SaslClientFactory.java 29 Nov 2005 14:29:28 -0000
@@ -97,8 +97,8 @@
* because of an error.
*/
SaslClient createSaslClient(String[] mechanisms, String authorizationID,
- String protocol, String serverName, Map props,
- CallbackHandler cbh)
+ String protocol, String serverName,
+ Map<String, ?> props, CallbackHandler cbh)
throws SaslException;
/**
@@ -114,5 +114,5 @@
* properties, if present in props, are ignored.
* @return a non-null array containing IANA-registered SASL mechanism names.
*/
- String[] getMechanismNames(Map props);
+ String[] getMechanismNames(Map<String, ?> props);
}
Index: javax/security/sasl/SaslServerFactory.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/security/sasl/SaslServerFactory.java,v
retrieving revision 1.3.2.5
diff -u -r1.3.2.5 SaslServerFactory.java
--- javax/security/sasl/SaslServerFactory.java 2 Nov 2005 00:43:41 -0000
1.3.2.5
+++ javax/security/sasl/SaslServerFactory.java 29 Nov 2005 14:29:28 -0000
@@ -95,7 +95,8 @@
* of an error.
*/
SaslServer createSaslServer(String mechanism, String protocol,
- String serverName, Map props, CallbackHandler
cbh)
+ String serverName, Map<String, ?> props,
+ CallbackHandler cbh)
throws SaslException;
/**
@@ -111,5 +112,5 @@
* properties, if present in props, are ignored.
* @return a non-null array containing IANA-registered SASL mechanism names.
*/
- String[] getMechanismNames(Map props);
+ String[] getMechanismNames(Map<String, ?> props);
}
Index: javax/sql/RowSet.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sql/RowSet.java,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 RowSet.java
--- javax/sql/RowSet.java 2 Aug 2005 20:12:36 -0000 1.2.2.1
+++ javax/sql/RowSet.java 29 Nov 2005 14:29:28 -0000
@@ -78,9 +78,9 @@
void setTransactionIsolation(int level) throws SQLException;
- Map getTypeMap() throws SQLException;
+ Map<String, Class<?>> getTypeMap() throws SQLException;
- void setTypeMap(Map map) throws SQLException;
+ void setTypeMap(Map<String, Class<?>> map) throws SQLException;
String getCommand();
Index: javax/swing/table/AbstractTableModel.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/table/AbstractTableModel.java,v
retrieving revision 1.10.2.3
diff -u -r1.10.2.3 AbstractTableModel.java
--- javax/swing/table/AbstractTableModel.java 6 Oct 2005 00:32:39 -0000
1.10.2.3
+++ javax/swing/table/AbstractTableModel.java 29 Nov 2005 14:29:29 -0000
@@ -125,7 +125,7 @@
*
* @return The class.
*/
- public Class getColumnClass(int columnIndex)
+ public Class<?> getColumnClass(int columnIndex)
{
return Object.class;
}
Index: javax/swing/table/TableColumnModel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/table/TableColumnModel.java,v
retrieving revision 1.5.2.3
diff -u -r1.5.2.3 TableColumnModel.java
--- javax/swing/table/TableColumnModel.java 2 Nov 2005 00:44:02 -0000
1.5.2.3
+++ javax/swing/table/TableColumnModel.java 29 Nov 2005 14:29:29 -0000
@@ -96,7 +96,7 @@
* getColumns
* @return Enumeration of columns
*/
- Enumeration getColumns();
+ Enumeration<TableColumn> getColumns();
/**
* Returns the index of the address@hidden TableColumn} with the given
identifier.
Index: javax/swing/text/AbstractDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/AbstractDocument.java,v
retrieving revision 1.9.2.13
diff -u -r1.9.2.13 AbstractDocument.java
--- javax/swing/text/AbstractDocument.java 27 Nov 2005 21:00:41 -0000
1.9.2.13
+++ javax/swing/text/AbstractDocument.java 29 Nov 2005 14:29:29 -0000
@@ -1257,7 +1257,7 @@
*
* @param names the names of the attributes to be removed
*/
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
attributes = getAttributeContext().removeAttributes(attributes, names);
}
@@ -1345,7 +1345,7 @@
*
* @return the names of the attributes of this element
*/
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return attributes.getAttributeNames();
}
Index: javax/swing/text/DefaultStyledDocument.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/text/DefaultStyledDocument.java,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 DefaultStyledDocument.java
--- javax/swing/text/DefaultStyledDocument.java 27 Nov 2005 21:00:42 -0000
1.1.2.7
+++ javax/swing/text/DefaultStyledDocument.java 29 Nov 2005 14:29:29 -0000
@@ -1490,7 +1490,7 @@
*
* @return an enumeration of all style names
*/
- public Enumeration getStyleNames()
+ public Enumeration<?> getStyleNames()
{
StyleContext context = (StyleContext) getAttributeContext();
return context.getStyleNames();
Index: javax/swing/text/SimpleAttributeSet.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/text/SimpleAttributeSet.java,v
retrieving revision 1.5.2.7
diff -u -r1.5.2.7 SimpleAttributeSet.java
--- javax/swing/text/SimpleAttributeSet.java 2 Nov 2005 00:44:03 -0000
1.5.2.7
+++ javax/swing/text/SimpleAttributeSet.java 29 Nov 2005 14:29:29 -0000
@@ -158,7 +158,7 @@
return tab.size();
}
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return tab.keys();
}
@@ -216,7 +216,7 @@
}
}
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
while (names.hasMoreElements())
{
Index: javax/swing/text/StyleContext.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/StyleContext.java,v
retrieving revision 1.2.2.8
diff -u -r1.2.2.8 StyleContext.java
--- javax/swing/text/StyleContext.java 26 Nov 2005 05:29:43 -0000 1.2.2.8
+++ javax/swing/text/StyleContext.java 29 Nov 2005 14:29:29 -0000
@@ -168,7 +168,7 @@
return attributes.getAttributeCount();
}
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return attributes.getAttributeNames();
}
@@ -195,7 +195,7 @@
fireStateChanged();
}
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
attributes = StyleContext.this.removeAttributes(attributes, names);
fireStateChanged();
@@ -323,7 +323,7 @@
return attrs.length / 2;
}
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return new Enumeration()
{
Index: javax/swing/tree/FixedHeightLayoutCache.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/tree/FixedHeightLayoutCache.java,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 FixedHeightLayoutCache.java
--- javax/swing/tree/FixedHeightLayoutCache.java 2 Aug 2005 20:12:39
-0000 1.2.2.2
+++ javax/swing/tree/FixedHeightLayoutCache.java 29 Nov 2005 14:29:29
-0000
@@ -174,7 +174,7 @@
* @param value0 TODO
* @returns Enumeration
*/
- public Enumeration getVisiblePathsFrom(TreePath value0)
+ public Enumeration<TreePath> getVisiblePathsFrom(TreePath value0)
{
return null; // TODO
} // getVisiblePathsFrom()
Index: javax/swing/tree/VariableHeightLayoutCache.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/tree/VariableHeightLayoutCache.java,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 VariableHeightLayoutCache.java
--- javax/swing/tree/VariableHeightLayoutCache.java 2 Aug 2005 20:12:39
-0000 1.2.2.2
+++ javax/swing/tree/VariableHeightLayoutCache.java 29 Nov 2005 14:29:29
-0000
@@ -188,7 +188,7 @@
* @param value0 TODO
* @returns Enumeration
*/
- public Enumeration getVisiblePathsFrom(TreePath value0) {
+ public Enumeration<TreePath> getVisiblePathsFrom(TreePath value0) {
return null; // TODO
} // getVisiblePathsFrom()
Index: javax/swing/undo/StateEdit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/undo/StateEdit.java,v
retrieving revision 1.7.2.1
diff -u -r1.7.2.1 StateEdit.java
--- javax/swing/undo/StateEdit.java 2 Aug 2005 20:12:39 -0000 1.7.2.1
+++ javax/swing/undo/StateEdit.java 29 Nov 2005 14:29:29 -0000
@@ -119,14 +119,14 @@
* The state of <code>object</code> at the time of constructing
* this <code>StateEdit</code>.
*/
- protected Hashtable preState;
+ protected Hashtable<Object, Object> preState;
/**
* The state of <code>object</code> at the time when address@hidden #end()}
* was called.
*/
- protected Hashtable postState;
+ protected Hashtable<Object, Object> postState;
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] [generics] Patch: FYI: generics cleanups,
Tom Tromey <=