aboutsummaryrefslogtreecommitdiff
path: root/usage_examples
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-07-18 02:28:29 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-07-18 02:28:29 +0200
commitbc35f73ae80802ab6758509481dacd66c5dc3285 (patch)
treec33e571bf81f11b04002de5042e08d4073efabaf /usage_examples
parent1e369a3aa408601a3ba23493a961acccaa5c9be2 (diff)
downloadlombok-bc35f73ae80802ab6758509481dacd66c5dc3285.tar.gz
lombok-bc35f73ae80802ab6758509481dacd66c5dc3285.tar.bz2
lombok-bc35f73ae80802ab6758509481dacd66c5dc3285.zip
Added text for the Synchronized annotation to the features pages. Also did some fixes in regards to whitespacing (some fancy footwork in regards to white-space: pre).
Diffstat (limited to 'usage_examples')
-rw-r--r--usage_examples/SynchronizedExample_post.jpage23
-rw-r--r--usage_examples/SynchronizedExample_pre.jpage20
2 files changed, 43 insertions, 0 deletions
diff --git a/usage_examples/SynchronizedExample_post.jpage b/usage_examples/SynchronizedExample_post.jpage
new file mode 100644
index 00000000..858bfbde
--- /dev/null
+++ b/usage_examples/SynchronizedExample_post.jpage
@@ -0,0 +1,23 @@
+public class SynchronizedExample {
+ private static final Object $LOCK = new Object[0];
+ private final Object $lock = new Object[0];
+ private final Object myLock = new Object();
+
+ public static void hello() {
+ synchronized($LOCK) {
+ System.out.println("world");
+ }
+ }
+
+ public int answerToLife() {
+ synchronized($lock) {
+ return 42;
+ }
+ }
+
+ public void foo() {
+ synchronized(myLock) {
+ System.out.println("bar");
+ }
+ }
+}
diff --git a/usage_examples/SynchronizedExample_pre.jpage b/usage_examples/SynchronizedExample_pre.jpage
new file mode 100644
index 00000000..f1e8afba
--- /dev/null
+++ b/usage_examples/SynchronizedExample_pre.jpage
@@ -0,0 +1,20 @@
+import lombok.Synchronized;
+
+public class SynchronizedExample {
+ private final Object myLock = new Object();
+
+ @Synchronized
+ public static void hello() {
+ System.out.println("world");
+ }
+
+ @Synchronized
+ public int answerToLife() {
+ return 42;
+ }
+
+ @Synchronized("myLock")
+ public void foo() {
+ System.out.println("bar");
+ }
+}