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

Last change on this file was 1236, checked in by wouter, 5 weeks ago
File size: 1.1 KB
Line 
1package testcode;
2
3import java.util.Collections;
4import java.util.Map;
5
6import org.eclipse.jdt.annotation.NonNull;
7
8//#PY #overrides the non-translatable annotation
9@StopHere
10
11/**
12 * Test for overriding annotations.
13 */
14public class Annotation {
15
16 Annotation() {
17 test1();
18 test2();
19 }
20
21 /**
22 * <br>
23 * <br>
24 */
25 @NonNull
26 public String test1() {
27 System.out.println("ok1");
28 return "";
29 }
30
31 // check that annotation of assignment inside if works.
32 // related to #159
33 public void test2() {
34 if (!false) {
35 //#PY text="ok2"
36 String text = "ko2";
37 System.out.println(text);
38 }
39 }
40
41 @Override
42 /**
43 * test problem with blank lines in comments
44 *
45 * if there is a multiline text
46 */
47 public @NonNull String toString() {
48 return "ok";
49 }
50
51 /**
52 *
53 * @param args the arguments of the call.
54 */
55 static public void main(String[] args) {
56 new Annotation();
57 }
58
59 @Deprecated
60 /**
61 * This replaces the previous getMap() method.
62 *
63 * @return actual agreemenets contained here
64 */
65 public @NonNull Map<@NonNull String, @NonNull String> getAgreements() {
66 return Collections.emptyMap();
67 }
68
69}
Note: See TracBrowser for help on using the repository browser.