Skip to content

Commit

Permalink
Merge pull request apache#89 from lyennon/master
Browse files Browse the repository at this point in the history
the anno.name() is always not null
  • Loading branch information
slievrly authored Jan 15, 2019
2 parents 0798371 + 9bb056f commit 33275c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
* Given name of the global transaction instance.
* @return Given name.
*/
String name() default "default";
String name() default "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.lang.reflect.Method;

import com.alibaba.fescar.common.exception.ShouldNeverHappenException;
import com.alibaba.fescar.common.util.StringUtils;
import com.alibaba.fescar.tm.api.DefaultFailureHandlerImpl;
import com.alibaba.fescar.tm.api.FailureHandler;
import com.alibaba.fescar.tm.api.TransactionalExecutor;
Expand Down Expand Up @@ -61,8 +62,9 @@ public int timeout() {

@Override
public String name() {
if (anno.name() != null) {
return anno.name();
String name = anno.name();
if (!StringUtils.isEmpty(name)) {
return name;
}
return formatMethod(methodInvocation.getMethod());
}
Expand Down

0 comments on commit 33275c7

Please sign in to comment.