]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreviewCode.txt
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / preferences / CodeFormatterPreviewCode.txt
CommitLineData
1b2798f6
EK
1/**
2 * This header comment may be left unformatted.
3 */
4
5package org.eclipse.formatter.example;
6
7/**
8 * Example class displaying the effects of various code formatting preferences.
9 * <p> See also {@link org.eclipse.editor.syntax}. </p>
10 *
11 * The blank line above may be cleared.
12 * @version 3.0
13 */
14public class Example extends Object {
15 /* This comment may be wrapped to multiple lines depending on the maximal line length. */
16 private int integer= 0;
17 // This single-line comment may be wrapped too...
18 private String string= "zero";
19
20 /**
21 * This comment shows the formatting of code snippets.
22 * <pre>
23 * while ((size = foo(size, max)) > 0) { System.out.println("bar"); }
24 * </pre>
25 * After this comment a blank line may be inserted.
26 * @param size The size
27 * @param max The maximum
28 */
29 public int foo(int size, int max) {
30
31 if (size < max) {
32 try {
33 size=(long)stream.available();
34 } catch (IOException e) {
35
36 }
37 } else if (size == max) {
38 ++size;
39 } else {
40 --size;
41 }
42 return size;
43 }
44}