File: T6253161.java

package info (click to toggle)
libnb-javaparser-java 7.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,688 kB
  • sloc: java: 189,590; sh: 3,082; xml: 2,085; makefile: 379
file content (36 lines) | stat: -rw-r--r-- 1,370 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * @test  /nodynamiccopyright/
 * @bug     6253161
 * @summary Compiler will fail to find the correct location of serial warnings for anonymous inner classes
 * @author  Seetharama Avadhanam
 * @compile -Xlint:serial -XDdev T6253161.java
 * @compile/ref=T6253161.out -Xlint:serial -XDdev -XDrawDiagnostics T6253161.java
 */
import java.util.List;
import java.util.ArrayList;

public class T6253161 {
    @SuppressWarnings("unchecked")
    public void anonymousMethod(){
           List list = new ArrayList<String>(){
           static final long serialVersionUID = 1;
           List list = new ArrayList<Integer>();
           public List<Integer> getMyList(){
                final List floatList = new ArrayList<Float>(){
                    List integerList = new ArrayList<Float>();
                    public List<Float> getMyList(){
                        for(int i=0;i<10;i++)
                            integerList.add((int)((Float.parseFloat(i+""))+(1.11F)));
                        return (List)(Object)integerList;
                    }
                    public void testMethods(){
                        //...
                    }
                }.getMyList();
                for(int i=0;i<10;i++)
                    list.add((Float)(floatList.get(i)) * 11.232F * i);
                return list;
            }
         }.getMyList();
    }
}