----- helper methods ----------------------------------------------------
1818
@VisibleForTesting
    public static List<IStruct> getAllTraits(IReferenceableInstance entityDefinition,
                                              TypeSystem typeSystem) throws AtlasException {
        List<IStruct> traitInfo = new LinkedList<>();
        for (String traitName : entityDefinition.getTraits()) {
            IStruct trait = entityDefinition.getTrait(traitName);
            String typeName = trait.getTypeName();
            Map<String, Object> valuesMap = trait.getValuesMap();
            traitInfo.add(new Struct(typeName, valuesMap));
            traitInfo.addAll(getSuperTraits(typeName, valuesMap, typeSystem));
        }
        return traitInfo;
    }
702034
@SuppressWarnings("unused") // expose utility check method to subclasses
    protected FormValidation checkDisplayName(@Nonnull View view, @CheckForNull String value) {
        if (StringUtils.isBlank(value)) {
            // no custom name, no need to check
            return FormValidation.ok();
        }
        for (View v: view.owner.getViews()) {
            if (v.getViewName().equals(view.getViewName())) {
                continue;
            }
            if (StringUtils.equals(v.getDisplayName(), value)) {
                return FormValidation.warning(Messages.View_DisplayNameNotUniqueWarning(value));
            }
        }
        return FormValidation.ok();
    }
526603
void generateRaCode(Definition def)
   {
      if (def.isUseRa())
      {
         generateClassCode(def, "Ra");
         generateClassCode(def, "RaMeta");
      }
      if (def.isGenAdminObject())
      {
         for (int i = 0; i < def.getAdminObjects().size(); i++)
         {
            generateMultiAdminObjectClassCode(def, "AoImpl", i);
            generateMultiAdminObjectClassCode(def, "AoInterface", i);
         }
      }
   }
1178609
function() {
        if (!this.isVirtual && !this.elementId) {
          this.elementId = guidFor(this);
        }

        this._super();

        // setup child views. be sure to clone the child views array first
        this._childViews = this._childViews.slice();

        Ember.assert("Only arrays are allowed for 'classNameBindings'", typeOf(this.classNameBindings) === 'array');
        this.classNameBindings = emberA(this.classNameBindings.slice());

        Ember.assert("Only arrays are allowed for 'classNames'", typeOf(this.classNames) === 'array');
        this.classNames = emberA(this.classNames.slice());
      }
747808
public function init(): void
    {
        parent::init();

        if ($this->default !== '' && $this->default !== null && !is_array($this->default)) {
            try {
                $default = Json::decode($this->default);

                if (is_array($default)) {
                    $this->default = $default;
                }
            } catch (InvalidArgumentException $exception) {}
        }
    }
994356
function(items, handler, userData) {
			if (this.choiceCallback) {
				return this.choiceCallback.call(handler, items, userData);
			}
			return null;
		}
167792
@Override
	public void generateSpecializedPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder, Set<JQLProjection> fieldList, boolean mapFields) {
		TypeName returnTypeName = method.getReturnClass();

		//ASSERT: returnType is a supported type
		
		// no column or too many columns
		AssertKripton.assertTrueOrInvalidMethodSignException(fieldList.size() == 1, method, "no way to understand which field is the result for this method");				

		SQLTransform t = SQLTransformer.lookup(returnTypeName);

		methodBuilder.addCode("$T result=", returnTypeName);
		t.generateDefaultValue(methodBuilder);
		methodBuilder.addCode(";\n");

		methodBuilder.addCode("\n");
		// methodBuilder.beginControlFlow("try");
		methodBuilder.beginControlFlow("if (_cursor.moveToFirst())");

		// generate index from columns
		methodBuilder.addCode("\n");

		if (TypeUtility.isNullable(returnTypeName)) {
			methodBuilder.addCode("if (_cursor.isNull(0)) { return null; }\n");
		} else {
			methodBuilder.addCode("if (_cursor.isNull(0)) { return ");
			t.generateDefaultValue(methodBuilder);
			methodBuilder.addCode("; }\n", t);
		}
		methodBuilder.addCode("result=");
		t.generateReadValueFromCursor(methodBuilder, method.getParent(), returnTypeName, "_cursor", "0");
		methodBuilder.addCode(";\n");

		// end cursor
		methodBuilder.endControlFlow();

		methodBuilder.addCode("return result;\n");
		// end method
		methodBuilder.endControlFlow();
	}
1076766
public function init() {
    parent::init();
    if (empty($this->options['id'])) {
      $this->options['id'] = $this->getId();
    }
  }
79882
public function validate() {

		if ($this->getEndAction() === null) {
			throw new ValidationException("'endAction' can't be null", 'endAction', $this);
		}
		if ($this->getPlannedEndDate() === null) {
			throw new ValidationException("'plannedEndDate' can't be null", 'plannedEndDate', $this);
		}
		if ($this->getSubscription() === null) {
			throw new ValidationException("'subscription' can't be null", 'subscription', $this);
		}
	}
1340051
protected void onBeforeRender() {
        super.onBeforeRender();
        if (runtimeModel.isEdit()) {
            for (QueryParameter parameter : convertMap.values()) {
                populateDependentParameters(parameter, null);
            }
        }
    }
993801
@Override
    public void visitMethod(final Method obj) {
        methodName = obj.getName();
        if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) {
            return;
        }

        List<String> parms = SignatureUtils.getParameterSignatures(obj.getSignature());

        if (!parms.isEmpty()) {
            boolean isStatic = obj.isStatic();
            isAbstract = obj.isAbstract();

            firstLocalReg = isStatic ? 0 : 1;
            for (String parmSig : parms) {
                firstLocalReg += SignatureUtils.getSignatureSize(parmSig);
            }

            sourceLines = getSourceLines(obj);
        }
    }
932987
function(Type) {
		if (Type) {
			if (this._map) {
				var classid = Type.$classid;
				var typeobj = this._map[classid];
				return typeobj ? true : false;
			}
			return false;
		} else {
			throw new Error("Something is undefined");
		}
	}
931406
private static void checkTypeAdapterForParam( SQLiteModelMethod method,
			String methodParamName, Class<? extends Annotation> annotation) {
		
		TypeName paramType=method.findParameterType(methodParamName);
		if (method.isSpreadParameter(methodParamName)) {
			if (paramType instanceof ArrayTypeName) {				
				paramType = ((ArrayTypeName) paramType).componentType;
			} else if (paramType instanceof ParameterizedTypeName) {				
				paramType = ((ParameterizedTypeName) paramType).typeArguments.get(0);
			} 
		}
		
		TypeName adapterType = method.getAdapterForParam(methodParamName);
		
		
		TypeName sourceType = TypeUtility.typeName(TypeAdapterHelper.detectSourceType(method, adapterType));
		TypeName uboxSourceType=sourceType;
		
		if (TypeUtility.isTypeWrappedPrimitive(sourceType)) {
			uboxSourceType=sourceType.unbox();
		}
		
		boolean expr=uboxSourceType.toString().equals(paramType.toString()) || sourceType.toString().equals(paramType.toString());
		
		
		AssertKripton.fail(!expr,
				"In DAO '%s', method '%s' has parameter '%s' uses @%s that manages type '%s' instead of '%s'", method.getParent().getName(), method.getName(),
				methodParamName, annotation.getSimpleName(),sourceType, paramType);

	}
682425
@SuppressWarnings("unchecked")
    @Override
	public <T> T by(int userId) {
	    User sfsUser = api.getUserById(userId);
	    if(sfsUser != null)
	        return (T)sfsUser.getProperty(APIKey.USER);
	    return null;
	}
699672
public void putInt(String key, int i) {
		checkNotNull(key);
		put(key, Integer.toString(i));
	}
1371363
private void initAfterList() {
        final List<ProcessAdvice> afterRequestProcessAdvices = new ArrayList<>();

        final Method invokeHolder = getInvokeHolder();
        final Class<?> processorClass = invokeHolder.getDeclaringClass();

        // 1. process method advice
        if (invokeHolder.isAnnotationPresent(After.class)) {
            final Class<? extends ProcessAdvice>[] acs = invokeHolder.getAnnotation(After.class).value();
            for (int i = 0; i < acs.length; i++) {
                final Class<? extends ProcessAdvice> ac = acs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(ac);
                afterRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }
        // 2. process class advice
        if (null != processorClass && processorClass.isAnnotationPresent(After.class)) {
            final Class<? extends ProcessAdvice>[] acs = invokeHolder.getAnnotation(After.class).value();
            for (int i = 0; i < acs.length; i++) {
                final Class<? extends ProcessAdvice> ac = acs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(ac);
                afterRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }

        this.afterRequestProcessAdvices = afterRequestProcessAdvices;
    }
928537
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $_i = count($params); $i < $_i; $i++) {
                if (self::FUNCTION_KEY == $params[$i]->getName()) {
                    $this->function = (string) $params[$i]->getValue();
                    break;
                }
            }
        }
    }