1 /* |
1 /* |
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
34 import com.sun.tools.javac.code.Kinds; |
34 import com.sun.tools.javac.code.Kinds; |
35 import com.sun.tools.javac.code.Scope; |
35 import com.sun.tools.javac.code.Scope; |
36 import com.sun.tools.javac.code.Symbol.*; |
36 import com.sun.tools.javac.code.Symbol.*; |
37 import com.sun.tools.javac.code.Type; |
37 import com.sun.tools.javac.code.Type; |
38 import com.sun.tools.javac.code.Type.ClassType; |
38 import com.sun.tools.javac.code.Type.ClassType; |
39 import com.sun.tools.javac.code.TypeTags; |
39 import com.sun.tools.javac.code.TypeTag; |
40 import com.sun.tools.javac.file.JavacFileManager; |
40 import com.sun.tools.javac.file.JavacFileManager; |
41 import com.sun.tools.javac.jvm.ClassReader; |
41 import com.sun.tools.javac.jvm.ClassReader; |
42 import com.sun.tools.javac.util.Context; |
42 import com.sun.tools.javac.util.Context; |
43 import com.sun.tools.javac.util.Names; |
43 import com.sun.tools.javac.util.Names; |
44 |
44 |
434 return "x" + (i - 1); |
434 return "x" + (i - 1); |
435 |
435 |
436 // The rest of this method assumes the local conventions in the test program |
436 // The rest of this method assumes the local conventions in the test program |
437 Type t = v.type; |
437 Type t = v.type; |
438 String s; |
438 String s; |
439 if (t.tag == TypeTags.CLASS) |
439 if (t.hasTag(TypeTag.CLASS)) |
440 s = ((ClassType) t).tsym.name.toString(); |
440 s = ((ClassType) t).tsym.name.toString(); |
441 else |
441 else |
442 s = t.toString(); |
442 s = t.toString(); |
443 return String.valueOf(Character.toLowerCase(s.charAt(0))) + i; |
443 return String.valueOf(Character.toLowerCase(s.charAt(0))) + i; |
444 } |
444 } |