source: java2python/core/src/test/java/testcode/Comment.java

Last change on this file was 841, checked in by wouter, 6 months ago

#264 removed withExtend BASE from the core Set #retainAll translator.

File size: 1.6 KB
Line 
1package testcode;
2
3import org.eclipse.jdt.annotation.NonNull;
4
5/**
6 * Test for overriding annotations.
7 */
8//#PY # this should replace the first annotation
9@Deprecated
10//#PY # this should replace the 2nd annotation
11@SuppressWarnings({ "yahoo" })
12//This comment should stay here
13//#PY # overrides the non-translatable annotation
14@StopHere
15/*#PY
16 * class Comment2:
17 * '''
18 * Full override of the class
19 * '''
20 * def __init__(self):
21 * print("ok2")
22*/
23class Comment2 {
24 public Comment2() {
25 System.out.println("ko2");
26 }
27}
28
29/*#PY
30 * class Comment3:
31 * '''
32 * Full override of the class
33 * '''
34 * def __init__(self):
35 * print("ok3")
36*/
37class Comment3 {
38 public Comment3() {
39 System.out.println("ko3");
40 }
41
42}
43
44public class Comment {
45
46 /**
47 * This comment should end up inside the constructor definition in python.
48 * This is a multiline comment to ensure it is translated using a triple-' block
49 */
50 Comment() {
51 test1();
52 new Comment2();
53 new Comment3();
54 System.out.println(test4());
55 //#PY print("ok5")
56 System.out.println("ko5");
57 System.out.println(test6());
58 }
59
60 //#PY # this should replace the first annotation
61 @Deprecated
62 //#PY # this should replace the 2nd annotation
63 @SuppressWarnings({ "yahoo" })
64 //This comment should stay here
65 /*#PY
66 * def test1(self):
67 * print("ok1")
68 */
69 public void test1() {
70 System.out.println("ko1");
71 }
72
73 /**
74 * This is the method 4 comment.
75 *
76 * @return test4 result string
77 */
78 public @NonNull String test4() {
79 //#PY return "ok4"
80 return "ko4";
81 }
82
83 public String test6() {
84 //#PY v="ok6"
85 String v = "ko6";
86 return v;
87 }
88
89 static public void main(String[] args) {
90 new Comment();
91 }
92
93}
Note: See TracBrowser for help on using the repository browser.