Package com.google.errorprone.bugpatterns.threadsafety.annotations

Examples of com.google.errorprone.bugpatterns.threadsafety.annotations.UnlockMethod


    category = JDK, severity = ERROR, maturity = EXPERIMENTAL)
public class UnlockMethodChecker extends AbstractLockMethodChecker {

  @Override
  protected ImmutableList<String> getLockExpressions(MethodTree tree) {
    UnlockMethod unlockMethod = ASTHelpers.getAnnotation(tree, UnlockMethod.class);
    return unlockMethod == null
        ? ImmutableList.<String>of()
        : ImmutableList.copyOf(unlockMethod.value());
  }
View Full Code Here


    /**
     * Checks {@link @UnlockMethod}-annotated methods.
     */
    private void handleUnlockAnnotatedMethods(MethodInvocationTree tree) {
      UnlockMethod annotation = ASTHelpers.getAnnotation(tree, UnlockMethod.class);
      if (annotation == null) {
        return;
      }
      for (String lockString : annotation.value()) {
        Optional<GuardedByExpression> guard = GuardedByBinder.bindString(
            lockString, GuardedBySymbolResolver.from(tree, state));
        // TODO(user): http://docs.oracle.com/javase/8/docs/api/java/util/Optional.html#ifPresent
        if (guard.isPresent()) {
          Optional<GuardedByExpression> lock =
View Full Code Here

TOP

Related Classes of com.google.errorprone.bugpatterns.threadsafety.annotations.UnlockMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.