summaryrefslogtreecommitdiff
path: root/test/scaladoc/resources/SI-4826.java
blob: 18a1cb86f244d1aafd24279dbcab648199836e3f (plain) (blame)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
/**
 * A package header
 */
package test.scaladoc;

/**
 * Testing java comments. The presence of a :marker:
 * tag is verified by tests.
 */
public class JavaComments {

    /** A field */
    public final int x;
    /** A field */
    protected int y;
    /** A field */
    private int z;

    /**
     * Inner class
     */
    public class Inner {
	/** Inner method */
	public void foo() {
	}
    }

    /**
     * A typed inner class
     * @param <T> some type
     */
    public class InnerTyped<T> {
    }

    /**
     * Compute the answer to the ultimate question of life, the
     * universe, and everything. :marker:
     * @param factor scaling factor to the answer
     * @return the answer to everything (42) scaled by factor
     */
    public int answer(int factor) {
	return 42 * factor;
    }

    /** Private */
    private double foo(double value) {
	return value;
    }

    /** Protected */
    protected double bar(double value) {
	return value;
    }

    /** No qualifier*/
    String noqualifier() {
	return "something";
    }

    /** Void */
    public void voidmethod(boolean t) {
    }

    /**
     * Typed parameter
     * @param <A> the parameter type
     * @param a parameter
     * @return something
     */
    public <A> void tparams(A a) {
    }

    /**
     * Typed parameter
     * @param <A> the return type
     * @param <B> the parameter typeA
     * @param b parameter
     * @return casts B to A
     */
    public <A, B extends A> A cast(B b) {
	return (B) b;
    }

}

// The following snippet is taken from Akka, it mainly tests interfaces

/**
 * Class that encapsulates all the Functional Interfaces
 * used for creating partial functions.
 *
 * This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
 */
public final class FI {

    /** Doc comment on constructor */
    private FI() {
    }

    /**
     * Functional interface for an application.
     *
     * @param <I> the input type, that this Apply will be applied to
     * @param <R> the return type, that the results of the application will have
     */
    public static interface Apply<I, R> {
	/**
	 * The application to perform.
	 *
	 * @param i  an instance that the application is performed on
	 * @return  the result of the application
	 */
	public R apply(I i) throws Exception;
    }

    /**
     * Functional interface for an application.
     *
     * @param <I1> the first input type, that this Apply will be applied to
     * @param <I2> the second input type, that this Apply will be applied to
     * @param <R> the return type, that the results of the application will have
     */
    public static interface Apply2<I1, I2, R> {
	/**
	 * The application to perform.
	 *
	 * @param i1  an instance that the application is performed on
	 * @param i2  an instance that the application is performed on
	 * @return  the result of the application
	 */
	public R apply(I1 i1, I2 i2) throws Exception;
    }

    /**
     * Functional interface for a predicate.
     *
     * @param <T> the type that the predicate will operate on.
     */
    public static interface TypedPredicate<T> {
	/**
	 * The predicate to evaluate.
	 *
	 * @param t  an instance that the predicate is evaluated on.
	 * @return  the result of the predicate
	 */
	public boolean defined(T t);
    }

    /**
     * Functional interface for a predicate.
     *
     * @param <T> the type that the predicate will operate on.
     * @param <U> the type that the predicate will operate on.
     */
    public static interface TypedPredicate2<T, U> {
	/**
	 * The predicate to evaluate.
	 *
	 * @param t  an instance that the predicate is evaluated on.
	 * @param u  an instance that the predicate is evaluated on.
	 * @return  the result of the predicate
	 */
	public boolean defined(T t, U u);
    }

    /**
     * Functional interface for an application.
     *
     * @param <I> the input type, that this Apply will be applied to
     */
    public static interface UnitApply<I> {
	/**
	 * The application to perform.
	 *
	 * @param i  an instance that the application is performed on
	 */
	public void apply(I i) throws Exception;
    }

    /**
     * Functional interface for an application.
     *
     * @param <I1> the first input type, that this Apply will be applied to
     * @param <I2> the second input type, that this Apply will be applied to
     */
    public static interface UnitApply2<I1, I2> {
	/**
	 * The application to perform.
	 *
	 * @param i1  an instance that the application is performed on
	 * @param i2  an instance that the application is performed on
	 */
	public void apply(I1 i1, I2 i2) throws Exception;
    }

    /**
     * Functional interface for an application.
     *
     * @param <I1> the first input type, that this Apply will be applied to
     * @param <I2> the second input type, that this Apply will be applied to
     * @param <I3> the third input type, that this Apply will be applied to
     */
    public static interface UnitApply3<I1, I2, I3> {
	/**
	 * The application to perform.
	 *
	 * @param i1  an instance that the application is performed on
	 * @param i2  an instance that the application is performed on
	 * @param i3  an instance that the application is performed on
	 */
	public void apply(I1 i1, I2 i2, I3 i3) throws Exception;
    }

    /**
     * Functional interface for an application.
     *
     * @param <I1> the first input type, that this Apply will be applied to
     * @param <I2> the second input type, that this Apply will be applied to
     * @param <I3> the third input type, that this Apply will be applied to
     * @param <I4> the fourth input type, that this Apply will be applied to
     */
    public static interface UnitApply4<I1, I2, I3, I4> {
	/**
	 * The application to perform.
	 *
	 * @param i1 an instance that the application is performed on
	 * @param i2 an instance that the application is performed on
	 * @param i3 an instance that the application is performed on
	 * @param i4 an instance that the application is performed on
	 */
	public void apply(I1 i1, I2 i2, I3 i3, I4 i4) throws Exception;
    }

    /**
     * Functional interface for an application.
     */
    public static interface UnitApplyVoid {
	/**
	 * The application to perform.
	 */
	public void apply() throws Exception;
    }

    /**
     * Package scoped functional interface for a predicate. Used internally to match against arbitrary types.
     */
    static interface Predicate {
	/**
	 * The predicate to evaluate.
	 *
	 * @param o  an instance that the predicate is evaluated on.
	 * @return  the result of the predicate
	 */
	public boolean defined(Object o);
    }

    /** comment about */
    /** a comment about */
    /** a comment */
    void foo() {}

    /** someone forgot to uncomment */
    //void thisMethod() {}
    /** and also this */
    //void otherMethod() {}
}

/**
 * Functional interface for an application.
 *
 * @param <I1> the first input type, that this Apply will be applied to
 * @param <I2> the second input type, that this Apply will be applied to
 * @param <I3> the third input type, that this Apply will be applied to
 * @param <I4> the fourth input type, that this Apply will be applied to
 */
public interface UnitApply4<I1, I2, I3, I4> {
    /**
     * The application to perform.
     *
     * @param i1 an instance that the application is performed on
     * @param i2 an instance that the application is performed on
     * @param i3 an instance that the application is performed on
     * @param i4 an instance that the application is performed on
     */
    public void apply(I1 i1, I2 i2, I3 i3, I4 i4) throws Exception;
}

/**
 * Functional interface for an application.
 */
public interface UnitApplyVoid {
    /**
     * The application to perform.
     */
    public void apply() throws Exception;
}

/**
 * Package scoped functional interface for a predicate. Used internally to match against arbitrary types.
 */
interface Predicate {
    /**
     * The predicate to evaluate.
     *
     * @param o  an instance that the predicate is evaluated on.
     * @return  the result of the predicate
     */
    public boolean defined(Object o);
}