Adds modifiers to the given declaration and corresponding modifiers tree.
199152
public static Optional<SuggestedFix> removeModifiers(
      ModifiersTree originalModifiers, VisitorState state, Set<Modifier> toRemove) {
    SuggestedFix.Builder fix = SuggestedFix.builder();
    List<ErrorProneToken> tokens = state.getTokensForNode(originalModifiers);
    int basePos = ((JCTree) originalModifiers).getStartPosition();
    boolean empty = true;
    for (ErrorProneToken tok : tokens) {
      Modifier mod = getTokModifierKind(tok);
      if (toRemove.contains(mod)) {
        empty = false;
        fix.replace(basePos + tok.pos(), basePos + tok.endPos() + 1, "");
      }
    }
    if (empty) {
      return Optional.empty();
    }
    return Optional.of(fix.build());
  }
622596
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlSkill.getModifiers().add(modifier);
		}
	}
203944
def _set_declarations(self, declarations):
        """"""
        assert isinstance(declarations, CodeStatement)
        self.declarations = declarations
        declarations.scope = self.body
337643
public MethodInfo addConstructor(Modifiers modifiers,
                                     TypeDesc[] params) {
        MethodDesc md = MethodDesc.forArguments(null, params);
        MethodInfo mi = new MethodInfo(this, modifiers, "<init>", md);
        mMethods.add(mi);
        return mi;
    }
380830
def add(self, modpath, name, origin):
        """"""
        self.map.setdefault(modpath, {}).setdefault(name, set()).add(origin)
891063
protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
		WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
	}
121290
private void addMemberProperties(
      AnnotationTypeDeclaration node, List<AnnotationTypeMemberDeclaration> members,
      Map<ExecutableElement, VariableElement> fieldElements) {
    if (members.isEmpty()) {
      return;
    }
    StringBuilder propertyDecls = new StringBuilder();
    StringBuilder propertyImpls = new StringBuilder();
    for (AnnotationTypeMemberDeclaration member : members) {
      ExecutableElement memberElement = member.getExecutableElement();
      String propName = NameTable.getAnnotationPropertyName(memberElement);
      String memberTypeStr = nameTable.getObjCType(memberElement.getReturnType());

      String fieldName = nameTable.getVariableShortName(fieldElements.get(memberElement));
      propertyDecls.append(UnicodeUtils.format("@property (readonly) %s%s%s;\n",
          memberTypeStr, memberTypeStr.endsWith("*") ? "" : " ", propName));
      if (NameTable.needsObjcMethodFamilyNoneAttribute(propName)) {
        propertyDecls.append(UnicodeUtils.format(
            "- (%s)%s OBJC_METHOD_FAMILY_NONE;\n", memberTypeStr, propName));
      }
      propertyImpls.append(UnicodeUtils.format("@synthesize %s = %s;\n", propName, fieldName));
    }
    node.addBodyDeclaration(NativeDeclaration.newInnerDeclaration(
        propertyDecls.toString(), propertyImpls.toString()));
  }
326842
void signedAdd(MutableBigInteger addend) {
        if (sign == 1)
            add(addend);
        else
            sign = sign * subtract(addend);

    }
251777
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlArtifact.getModifiers().add(modifier);
		}
	}
1253229
function register_modifier($modifier, $modifier_impl)
	{
		$this->_plugins['modifier'][$modifier] =
		array($modifier_impl, null, null, false);
	}
566759
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlCapacity.getModifiers().add(modifier);
		}
	}
1161556
private static int adjustedClassModifiersForClassWriting(ClassNode classNode) {
        int modifiers = classNode.getModifiers();
        boolean needsSuper = !classNode.isInterface();
        modifiers = needsSuper ? modifiers | ACC_SUPER : modifiers & ~ACC_SUPER;
        // eliminate static
        modifiers = modifiers & ~ACC_STATIC;
        modifiers = fixInnerClassModifiers(classNode, modifiers);

        // (JLS §9.1.1.1). Such a class file must not have its ACC_FINAL, ACC_SUPER or ACC_ENUM flags set.
        if (classNode.isInterface()) {
            modifiers = modifiers & ~ACC_ENUM;
            modifiers = modifiers & ~ACC_FINAL;
        }
        return modifiers;
    }
218373
private void addDefaultAccessors(
      AnnotationTypeDeclaration node, List<AnnotationTypeMemberDeclaration> members) {
    TypeElement type = node.getTypeElement();
    for (AnnotationTypeMemberDeclaration member : members) {
      ExecutableElement memberElement = member.getExecutableElement();
      AnnotationValue defaultValue = memberElement.getDefaultValue();
      if (defaultValue == null || defaultValue.getValue() == null) {
        continue;
      }

      TypeMirror memberType = memberElement.getReturnType();
      String propName = NameTable.getAnnotationPropertyName(memberElement);

      ExecutableElement defaultGetterElement = GeneratedExecutableElement.newMethodWithSelector(
          propName + "Default", memberType, type)
          .addModifiers(Modifier.STATIC);
      MethodDeclaration defaultGetter = new MethodDeclaration(defaultGetterElement);
      defaultGetter.setHasDeclaration(false);
      Block defaultGetterBody = new Block();
      defaultGetter.setBody(defaultGetterBody);
      defaultGetterBody.addStatement(new ReturnStatement(
          translationUtil.createAnnotationValue(memberType, defaultValue)));
      node.addBodyDeclaration(defaultGetter);
    }
  }
630252
public MethodInfo addDefaultConstructor() {
        Modifiers modifiers = new Modifiers();
        modifiers.setPublic(true);
        MethodInfo mi = addConstructor(modifiers, null, null);
        CodeBuilder builder = new CodeBuilder(mi);
        builder.loadThis();
        builder.invokeSuperConstructor();
        builder.returnVoid();
        return mi;
    }
1264934
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlEnumeration.getModifiers().add(modifier);
		}
	}
1275779
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlAgent.getModifiers().add(modifier);
		}
	}
9462
public FieldInfo addField(Modifiers modifiers,
                              String fieldName,
                              TypeDesc type) {
        FieldInfo fi = new FieldInfo(this, modifiers, fieldName, type);
        mFields.add(fi);
        return fi;
    }