You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by db...@apache.org on 2013/10/15 08:46:05 UTC

svn commit: r1532219 - in /commons/proper/bcel/trunk/src/main/java/org/apache/bcel: classfile/ConstantUtf8.java generic/ObjectType.java verifier/VerifierAppFrame.java verifier/VerifierFactoryListModel.java

Author: dbrosius
Date: Tue Oct 15 06:46:05 2013
New Revision: 1532219

URL: http://svn.apache.org/r1532219
Log:
fix generics problems

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ObjectType.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierFactoryListModel.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java?rev=1532219&r1=1532218&r2=1532219&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java Tue Oct 15 06:46:05 2013
@@ -70,7 +70,7 @@ public final class ConstantUtf8 extends 
         considered++;
         if (cache == null)  {
             cache = new LinkedHashMap<String, ConstantUtf8>(INITIAL_CACHE_CAPACITY, 0.75f, true) {
-                protected boolean removeEldestEntry(Map.Entry eldest) {
+                protected boolean removeEldestEntry(Map.Entry<String, ConstantUtf8> eldest) {
                      return size() > MAX_CACHE_ENTRIES;
                 }
             };

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ObjectType.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ObjectType.java?rev=1532219&r1=1532218&r2=1532219&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ObjectType.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ObjectType.java Tue Oct 15 06:46:05 2013
@@ -44,7 +44,7 @@ public class ObjectType extends Referenc
             cache = new LinkedHashMap<String, ObjectType>(INITIAL_CACHE_CAPACITY, 0.75f, true) {
 
 
-            protected boolean removeEldestEntry(Map.Entry eldest) {
+            protected boolean removeEldestEntry(Map.Entry<String, ObjectType> eldest) {
                return size() > MAX_CACHE_ENTRIES;
             }
 

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java?rev=1532219&r1=1532218&r2=1532219&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java Tue Oct 15 06:46:05 2013
@@ -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();
+    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();
@@ -257,10 +257,10 @@ public class VerifierAppFrame extends JF
             pass2TextPane.setText("");
             pass2TextPane.setBackground(Color.yellow);
             pass3aTextPane.setText("");
-            pass3aJList.setListData(new Object[0]);
+            pass3aJList.setListData(new String[0]);
             pass3aTextPane.setBackground(Color.yellow);
             pass3bTextPane.setText("");
-            pass3bJList.setListData(new Object[0]);
+            pass3bJList.setListData(new String[0]);
             pass3bTextPane.setBackground(Color.yellow);
         } else { // Must be VERIFIED_OK, Pass 1 does not know VERIFIED_NOTYET
             pass1TextPane.setBackground(Color.green);
@@ -271,10 +271,10 @@ public class VerifierAppFrame extends JF
                 pass2TextPane.setBackground(Color.red);
                 pass3aTextPane.setText("");
                 pass3aTextPane.setBackground(Color.yellow);
-                pass3aJList.setListData(new Object[0]);
+                pass3aJList.setListData(new String[0]);
                 pass3bTextPane.setText("");
                 pass3bTextPane.setBackground(Color.yellow);
-                pass3bJList.setListData(new Object[0]);
+                pass3bJList.setListData(new String[0]);
             } else { // must be Verified_OK, because Pass1 was OK (cannot be Verified_NOTYET).
                 pass2TextPane.setText(vr.getMessage());
                 pass2TextPane.setBackground(Color.green);

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierFactoryListModel.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierFactoryListModel.java?rev=1532219&r1=1532218&r2=1532219&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierFactoryListModel.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/VerifierFactoryListModel.java Tue Oct 15 06:46:05 2013
@@ -33,7 +33,7 @@ import javax.swing.event.ListDataListene
  * @author Enver Haase
  */
 public class VerifierFactoryListModel implements org.apache.bcel.verifier.VerifierFactoryObserver,
-        javax.swing.ListModel {
+        javax.swing.ListModel<String> {
 
     private List<ListDataListener> listeners = new ArrayList<ListDataListener>();
     private Set<String> cache = new TreeSet<String>();
@@ -76,7 +76,7 @@ public class VerifierFactoryListModel im
     }
 
 
-    public synchronized Object getElementAt( int index ) {
-        return (cache.toArray())[index];
+    public synchronized String getElementAt( int index ) {
+        return (cache.toArray(new String[cache.size()]))[index];
     }
 }