aboutsummaryrefslogtreecommitdiff
path: root/usage_examples
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-03-04 23:16:49 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-03-04 23:16:49 +0100
commitf956ba1e337699206052a016da65f4f02ac6825b (patch)
tree53b0c638275ebfa8a3d1133c1d389ef700460572 /usage_examples
parente5574133363c8b718329e07a73bf161416485da5 (diff)
parentfbab1ca77cb8306843e26c5bad91186b34563282 (diff)
downloadlombok-f956ba1e337699206052a016da65f4f02ac6825b.tar.gz
lombok-f956ba1e337699206052a016da65f4f02ac6825b.tar.bz2
lombok-f956ba1e337699206052a016da65f4f02ac6825b.zip
[configuration] Merge branch 'master' as we work on configuration.
* Conflict due to adding topic() feature to logger in master, and 'field name' feature in config branch. * master has since updated to shiny new eclipse dep versions and the 'ant eclipseForDebugging' feature, but this branch added deps. Addressed that. * Renamed 'loggerCategory' to 'loggerTopic'. I know, that wasn't exactly right to do in a merge, but, there you have it. * Test infrastructure changed in configuration branch, and tests had been added in master branch. Conflicts: build.xml buildScripts/ivy.xml src/core/lombok/eclipse/handlers/HandleLog.java src/core/lombok/extern/apachecommons/CommonsLog.java src/core/lombok/extern/java/Log.java src/core/lombok/extern/log4j/Log4j.java src/core/lombok/extern/log4j/Log4j2.java src/core/lombok/javac/handlers/HandleLog.java test/transform/resource/after-ecj/ValInTryWithResources.java
Diffstat (limited to 'usage_examples')
-rw-r--r--usage_examples/DataExample_post.jpage4
-rw-r--r--usage_examples/EqualsAndHashCodeExample_post.jpage4
-rw-r--r--usage_examples/LogExample_post.jpage14
-rw-r--r--usage_examples/LogExample_pre.jpage15
-rw-r--r--usage_examples/ValueExample_post.jpage4
5 files changed, 29 insertions, 12 deletions
diff --git a/usage_examples/DataExample_post.jpage b/usage_examples/DataExample_post.jpage
index 3dc675e9..29e7e328 100644
--- a/usage_examples/DataExample_post.jpage
+++ b/usage_examples/DataExample_post.jpage
@@ -55,7 +55,7 @@ public class DataExample {
}
@Override public int hashCode() {
- final int PRIME = 31;
+ final int PRIME = 59;
int result = 1;
final long temp1 = Double.doubleToLongBits(this.getScore());
result = (result*PRIME) + (this.getName() == null ? 0 : this.getName().hashCode());
@@ -101,7 +101,7 @@ public class DataExample {
}
@Override public int hashCode() {
- final int PRIME = 31;
+ final int PRIME = 59;
int result = 1;
result = (result*PRIME) + (this.getName() == null ? 0 : this.getName().hashCode());
result = (result*PRIME) + (this.getValue() == null ? 0 : this.getValue().hashCode());
diff --git a/usage_examples/EqualsAndHashCodeExample_post.jpage b/usage_examples/EqualsAndHashCodeExample_post.jpage
index 4a90e7dc..aa6a44ba 100644
--- a/usage_examples/EqualsAndHashCodeExample_post.jpage
+++ b/usage_examples/EqualsAndHashCodeExample_post.jpage
@@ -24,7 +24,7 @@ public class EqualsAndHashCodeExample {
}
@Override public int hashCode() {
- final int PRIME = 31;
+ final int PRIME = 59;
int result = 1;
final long temp1 = Double.doubleToLongBits(this.score);
result = (result*PRIME) + (this.name == null ? 0 : this.name.hashCode());
@@ -57,7 +57,7 @@ public class EqualsAndHashCodeExample {
}
@Override public int hashCode() {
- final int PRIME = 31;
+ final int PRIME = 59;
int result = 1;
result = (result*PRIME) + super.hashCode();
result = (result*PRIME) + this.width;
diff --git a/usage_examples/LogExample_post.jpage b/usage_examples/LogExample_post.jpage
index cbdc5a9e..eab3b046 100644
--- a/usage_examples/LogExample_post.jpage
+++ b/usage_examples/LogExample_post.jpage
@@ -1,5 +1,5 @@
public class LogExample {
- private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);
+ private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());
public static void main(String... args) {
log.error("Something's wrong here");
@@ -7,9 +7,17 @@ public class LogExample {
}
public class LogExampleOther {
- private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(java.util.List.class);
+ private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExampleOther.class);
public static void main(String... args) {
- log.warn("Something might be wrong here");
+ log.error("Something else is wrong here");
+ }
+}
+
+public class LogExampleCategory {
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("CounterLog");
+
+ public static void main(String... args) {
+ log.error("Calling the 'CounterLog' with a message");
}
}
diff --git a/usage_examples/LogExample_pre.jpage b/usage_examples/LogExample_pre.jpage
index 7ab64cd4..ba27dd27 100644
--- a/usage_examples/LogExample_pre.jpage
+++ b/usage_examples/LogExample_pre.jpage
@@ -1,4 +1,5 @@
-import lombok.extern.slf4j.Log;
+import lombok.extern.java.Log;
+import lombok.extern.slf4j.Slf4j;
@Log
public class LogExample {
@@ -8,10 +9,18 @@ public class LogExample {
}
}
-@Log(java.util.List.class)
+@Slf4j
public class LogExampleOther {
public static void main(String... args) {
- log.warn("Something might be wrong here");
+ log.error("Something else is wrong here");
+ }
+}
+
+@CommonsLog(topic="CounterLog")
+public class LogExampleCategory {
+
+ public static void main(String... args) {
+ log.error("Calling the 'CounterLog' with a message");
}
}
diff --git a/usage_examples/ValueExample_post.jpage b/usage_examples/ValueExample_post.jpage
index ac9b64d1..4ac8654e 100644
--- a/usage_examples/ValueExample_post.jpage
+++ b/usage_examples/ValueExample_post.jpage
@@ -46,7 +46,7 @@ public final class ValueExample {
@java.lang.Override
public int hashCode() {
- final int PRIME = 31;
+ final int PRIME = 59;
int result = 1;
final Object $name = this.getName();
result = result * PRIME + ($name == null ? 0 : $name.hashCode());
@@ -103,7 +103,7 @@ public final class ValueExample {
@java.lang.Override
public int hashCode() {
- final int PRIME = 31;
+ final int PRIME = 59;
int result = 1;
final Object $name = this.getName();
result = result * PRIME + ($name == null ? 0 : $name.hashCode());