With Java 7, you can just say: JList<String> pass3bJList = new JList<>();
instead of: JList<String> pass3bJList = new JList<String>(); Gary ---------- Forwarded message ---------- From: <s...@apache.org> Date: Thu, Aug 13, 2015 at 12:51 PM Subject: svn commit: r1695768 - in /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier: VerifierAppFrame.java VerifierFactoryListModel.java To: comm...@commons.apache.org Author: sebb Date: Thu Aug 13 19:51:02 2015 New Revision: 1695768 URL: http://svn.apache.org/r1695768 Log: Generics Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierFactoryListModel.java Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java?rev=1695768&r1=1695767&r2=1695768&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java Thu Aug 13 19:51:02 2015 @@ -58,7 +58,7 @@ public class VerifierAppFrame extends JF JPanel jPanel2 = new JPanel(); JSplitPane jSplitPane2 = new JSplitPane(); JPanel jPanel3 = new JPanel(); - JList classNamesJList = new JList(); // TODO Java7 makes this generic + JList<String> classNamesJList = new JList<String>(); GridLayout gridLayout1 = new GridLayout(); JPanel messagesPanel = new JPanel(); GridLayout gridLayout2 = new GridLayout(); @@ -83,8 +83,8 @@ public class VerifierAppFrame extends JF JScrollPane jScrollPane5 = new JScrollPane(); JScrollPane jScrollPane6 = new JScrollPane(); JScrollPane jScrollPane7 = new JScrollPane(); - JList pass3aJList = new JList(); - JList pass3bJList = new JList(); + JList<String> pass3aJList = new JList<String>(); + JList<String> pass3bJList = new JList<String>(); JTextPane pass3aTextPane = new JTextPane(); JTextPane pass3bTextPane = new JTextPane(); JMenu jMenu2 = new JMenu(); Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierFactoryListModel.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierFactoryListModel.java?rev=1695768&r1=1695767&r2=1695768&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierFactoryListModel.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierFactoryListModel.java Thu Aug 13 19:51:02 2015 @@ -32,7 +32,7 @@ import javax.swing.event.ListDataListene * @version $Id$ */ public class VerifierFactoryListModel implements org.apache.commons.bcel6.verifier.VerifierFactoryObserver, - javax.swing.ListModel { // TODO Java7 makes ListModel generic + javax.swing.ListModel<String> { private final List<ListDataListener> listeners = new ArrayList<ListDataListener>(); private final Set<String> cache = new TreeSet<String>(); @@ -73,7 +73,7 @@ public class VerifierFactoryListModel im } - public synchronized Object getElementAt( int index ) { + public synchronized String getElementAt( int index ) { return (cache.toArray(new String[cache.size()]))[index]; } } -- E-Mail: garydgreg...@gmail.com | ggreg...@apache.org Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory