aboutsummaryrefslogtreecommitdiff
path: root/src/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-07-18 00:06:42 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-07-18 00:06:42 +0200
commit97974b9104430d4c31ef003da3643a7905af46c6 (patch)
tree09f4afd6bb0b33d27db5ea22ffe6d79e147770c0 /src/lombok
parent2f74334b6da4e2dd2e8a6deaaf452680650b4fc3 (diff)
downloadlombok-97974b9104430d4c31ef003da3643a7905af46c6.tar.gz
lombok-97974b9104430d4c31ef003da3643a7905af46c6.tar.bz2
lombok-97974b9104430d4c31ef003da3643a7905af46c6.zip
Refactored the name of the cleanup method arg to 'value'.
Diffstat (limited to 'src/lombok')
-rw-r--r--src/lombok/Cleanup.java2
-rw-r--r--src/lombok/eclipse/handlers/HandleCleanup.java4
-rw-r--r--src/lombok/javac/handlers/HandleCleanup.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/lombok/Cleanup.java b/src/lombok/Cleanup.java
index 7d0fcc3c..ce9e0aa9 100644
--- a/src/lombok/Cleanup.java
+++ b/src/lombok/Cleanup.java
@@ -78,5 +78,5 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
public @interface Cleanup {
/** The name of the method that cleans up the resource. By default, 'close'. The method must not have any parameters. */
- String cleanupMethod() default "close";
+ String value() default "close";
}
diff --git a/src/lombok/eclipse/handlers/HandleCleanup.java b/src/lombok/eclipse/handlers/HandleCleanup.java
index 29f1ec7c..a256b8e3 100644
--- a/src/lombok/eclipse/handlers/HandleCleanup.java
+++ b/src/lombok/eclipse/handlers/HandleCleanup.java
@@ -51,7 +51,7 @@ import org.mangosdk.spi.ProviderFor;
@ProviderFor(EclipseAnnotationHandler.class)
public class HandleCleanup implements EclipseAnnotationHandler<Cleanup> {
public boolean handle(AnnotationValues<Cleanup> annotation, Annotation ast, Node annotationNode) {
- String cleanupName = annotation.getInstance().cleanupMethod();
+ String cleanupName = annotation.getInstance().value();
if ( cleanupName.length() == 0 ) {
annotationNode.addError("cleanupName cannot be the empty string.");
return true;
@@ -146,7 +146,7 @@ public class HandleCleanup implements EclipseAnnotationHandler<Cleanup> {
unsafeClose.receiver = receiver;
long nameSourcePosition = (long)ast.sourceStart << 32 | ast.sourceEnd;
if ( ast.memberValuePairs() != null ) for ( MemberValuePair pair : ast.memberValuePairs() ) {
- if ( pair.name != null && new String(pair.name).equals("cleanupMethod") ) {
+ if ( pair.name != null && new String(pair.name).equals("value") ) {
nameSourcePosition = (long)pair.value.sourceStart << 32 | pair.value.sourceEnd;
break;
}
diff --git a/src/lombok/javac/handlers/HandleCleanup.java b/src/lombok/javac/handlers/HandleCleanup.java
index 04ed2ed6..7a2f232d 100644
--- a/src/lombok/javac/handlers/HandleCleanup.java
+++ b/src/lombok/javac/handlers/HandleCleanup.java
@@ -53,7 +53,7 @@ import com.sun.tools.javac.util.Name;
@ProviderFor(JavacAnnotationHandler.class)
public class HandleCleanup implements JavacAnnotationHandler<Cleanup> {
@Override public boolean handle(AnnotationValues<Cleanup> annotation, JCAnnotation ast, Node annotationNode) {
- String cleanupName = annotation.getInstance().cleanupMethod();
+ String cleanupName = annotation.getInstance().value();
if ( cleanupName.length() == 0 ) {
annotationNode.addError("cleanupName cannot be the empty string.");
return true;