KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > cleanup > RemoveRedundantCasts


1 package org.netbeans.test.cleanup;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5 import javax.swing.AbstractButton JavaDoc;
6 import javax.swing.JButton JavaDoc;
7
8 /**
9  * @author leon chiver
10  */

11 public class RemoveRedundantCasts {
12
13     public void jbuttonToButton() {
14         JButton JavaDoc jb = new JButton JavaDoc();
15         AbstractButton JavaDoc b = (AbstractButton JavaDoc) jb;
16         jb.setVisible(true);
17         b.setVisible(true);
18     }
19     
20     public void method1(String JavaDoc s) {
21         String JavaDoc k = (String JavaDoc) s;
22         k = k + "";
23     }
24     
25     public String JavaDoc method2() {
26         method1((String JavaDoc) method2());
27         return "stack";
28     }
29     
30 }
31
Popular Tags