Is statement an initializer for a synthetic field?
332551
public static boolean isSyntheticInit(JCTree stat) {
        if (stat.hasTag(EXEC)) {
            JCExpressionStatement exec = (JCExpressionStatement)stat;
            if (exec.expr.hasTag(ASSIGN)) {
                JCAssign assign = (JCAssign)exec.expr;
                if (assign.lhs.hasTag(SELECT)) {
                    JCFieldAccess select = (JCFieldAccess)assign.lhs;
                    if (select.sym != null &&
                        (select.sym.flags() & SYNTHETIC) != 0) {
                        Name selected = name(select.selected);
                        if (selected != null && selected == selected.table.names._this)
                            return true;
                    }
                }
            }
        }
        return false;
    }
1255171
def _init_field(self, setting, field_class, name, code=None):
        
        kwargs = {
            "label": setting["label"] + ":",
            "required": setting["type"] in (int, float),
            "initial": getattr(settings, name),
            "help_text": self.format_help(setting["description"]),
        }
        if setting["choices"]:
            field_class = forms.ChoiceField
            kwargs["choices"] = setting["choices"]
        field_instance = field_class(**kwargs)
        code_name = ('_modeltranslation_' + code if code else '')
        self.fields[name + code_name] = field_instance
        css_class = field_class.__name__.lower()
        field_instance.widget.attrs["class"] = css_class
        if code:
            field_instance.widget.attrs["class"] += " modeltranslation"
130241
public void init(Converter converter, Record recordTarget, int iKeyArea)
    {
        super.init(converter, Constants.BLANK, true);

        m_iKeyArea = iKeyArea;
        m_recordTarget = recordTarget;
        m_objTarget = Integer.toString(iKeyArea);
        
        m_strAltDesc = "Key " + m_objTarget;    // Default
        if (m_recordTarget != null)
        {
            BaseField mainField = m_recordTarget.getTable().getCurrentTable().getRecord().getKeyArea(m_iKeyArea).getField(DBConstants.MAIN_KEY_FIELD);
            m_strAltDesc = mainField.getFieldDesc();
        }
    }
378591
public void init(BaseField field, BasePanel screenParent, BasePanel subScreen)
    {
        super.init(field);
        m_iCurrentScreenNo = -1;
        m_screenParent = screenParent;
        this.setCurrentSubScreen(subScreen);
    }
1342413
def initialize_fields(self):
        
        for field in dir(self):
            obj = getattr(self, field)
            if isinstance(obj, Field):
                self._meta.fields[field] = obj
237885
public void writeInitField()
    {
        Record recLogicFile = this.getRecord(LogicFile.LOGIC_FILE_FILE);
        try   {
            String strClassName;
            Record recClassInfo = this.getMainRecord();
            FieldData recFieldData = (FieldData)this.getRecord(FieldData.FIELD_DATA_FILE);
            strClassName = recClassInfo.getField(ClassInfo.CLASS_NAME).getString();
            if (this.readThisMethod("initField"))
                this.writeThisMethod(CodeType.THICK);
            else
            {
                String strInitField = this.getInitField(recFieldData, false, false);
                if (strInitField.length() != 0)
                {
                    recLogicFile.getField(LogicFile.METHOD_NAME).setString("initField");
                    recLogicFile.setKeyArea(LogicFile.METHOD_CLASS_NAME_KEY);
                    if (!recLogicFile.seek("="))
                    {
                        this.writeMethodInterface(null, "initField", "int", "boolean displayOption", "", "Initialize the field.", null);
                        String setOp = ".setString";
                        if ((strInitField.equalsIgnoreCase("todaysDate()")) || (strInitField.equalsIgnoreCase("currentTime()")) || (strInitField.equalsIgnoreCase("getUserID()")))
                            setOp = ".setValue";
                        if (strInitField.length() > 0)
                            if ((strInitField.charAt(0) == 'k') ||
                                (Character.isDigit(strInitField.charAt(0))) ||
                                (strInitField.indexOf(".k") != -1))
                            setOp = ".setValue";
                        if ((strInitField.equals("true")) || (strInitField.equals("false")))
                            setOp = ".setState";
                        if ((strClassName.equalsIgnoreCase("IntegerField"))   //**Change this to look through the base classes for NumberField
                            || (strClassName.equalsIgnoreCase("ShortField"))
                            || (strClassName.equalsIgnoreCase("FloatField"))
                            || (strClassName.equalsIgnoreCase("RealField"))
                            || (strClassName.equalsIgnoreCase("CurrencysField"))
                            || (strClassName.equalsIgnoreCase("DoubleField")))
                                setOp = ".setValue";
                        if (strInitField.equals("all"))
                        {
                            strInitField = "\"all\""; // HACK
                            setOp = ".setString";
                        }
                        if ((strInitField.indexOf('_') != -1) && (strInitField.indexOf('.') == -1))
                        {
                            strInitField = "\"\"/**" + strInitField + "*/";   // HACK
                            setOp = ".setString";
                        }
                        if (strInitField != strClassName)
                            m_StreamOut.writeit("\treturn this" + setOp + "(" + strInitField + ", displayOption, DBConstants.INIT_MOVE);\n");
                        m_StreamOut.writeit("}\n");
                    }
                }
            }
        } catch (DBException ex)    {
            ex.printStackTrace();
        } finally {
            recLogicFile.setKeyArea(LogicFile.SEQUENCE_KEY);   // set this back
        }
    }
926872
private boolean isSetterForField(ExecutableElement setter, VariableElement field) {
    return setter.getParameters() != null
        && setter.getParameters().size() == 1
        && setter.getParameters().get(0).asType().equals(field.asType());
    // TODO inheritance? TypeUtils is applicable?
  }
176101
function isInferrable(node, init) {
            if (node.type !== "TSTypeAnnotation" || !node.typeAnnotation) {
                return false;
            }

            if (!init) {
                return false;
            }

            const annotation = node.typeAnnotation;

            if (annotation.type === "TSStringKeyword") {
                return (
                    (init.type === "Literal" &&
                        typeof init.value === "string") ||
                    (init.type === "TemplateElement" &&
                        (!init.expressions || init.expressions.length === 0))
                );
            }

            if (annotation.type === "TSBooleanKeyword") {
                return init.type === "Literal";
            }

            if (annotation.type === "TSNumberKeyword") {
                // Infinity is special
                if (
                    (init.type === "UnaryExpression" &&
                        init.operator === "-" &&
                        init.argument.type === "Identifier" &&
                        init.argument.name === "Infinity") ||
                    (init.type === "Identifier" && init.name === "Infinity")
                ) {
                    return true;
                }

                return (
                    init.type === "Literal" && typeof init.value === "number"
                );
            }

            return false;
        }
600413
private void initLiveOnEntrySets(OptFunctionNode fn, Node[] statementNodes)
    {
        int listLength = fn.getVarCount();
        itsUseBeforeDefSet = new BitSet(listLength);
        itsNotDefSet = new BitSet(listLength);
        itsLiveOnEntrySet = new BitSet(listLength);
        itsLiveOnExitSet = new BitSet(listLength);
        for (int i = itsStartNodeIndex; i <= itsEndNodeIndex; i++) {
            Node n = statementNodes[i];
            lookForVariableAccess(fn, n);
        }
        itsNotDefSet.flip(0, listLength);         // truth in advertising
    }
445188
private Object initializeEntity(Object key, EntityMetadata entityMetadata)
            throws InstantiationException, IllegalAccessException
    {
        Object entity = null;
        entity = entityMetadata.getEntityClazz().newInstance();
        if (key != null)
        {
            PropertyAccessorHelper.setId(entity, entityMetadata, key);
        }
        return entity;
    }
1157621
public void init(BaseField field, String iMainFilesField)
    {
        super.init(field);
        m_iMainFilesFieldSeq = iMainFilesField;
        m_bReadMove = false;  // Don't move on read!
    }
884735
public final void variableInitializer() throws RecognitionException {
		int variableInitializer_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 44) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:495:5: ( arrayInitializer | expression )
			int alt60=2;
			int LA60_0 = input.LA(1);
			if ( (LA60_0==121) ) {
				alt60=1;
			}
			else if ( ((LA60_0 >= CharacterLiteral && LA60_0 <= DecimalLiteral)||LA60_0==FloatingPointLiteral||(LA60_0 >= HexLiteral && LA60_0 <= Identifier)||(LA60_0 >= OctalLiteral && LA60_0 <= StringLiteral)||LA60_0==29||LA60_0==36||(LA60_0 >= 40 && LA60_0 <= 41)||(LA60_0 >= 44 && LA60_0 <= 45)||LA60_0==53||LA60_0==65||LA60_0==67||(LA60_0 >= 70 && LA60_0 <= 71)||LA60_0==77||(LA60_0 >= 79 && LA60_0 <= 80)||LA60_0==82||LA60_0==85||LA60_0==92||LA60_0==94||(LA60_0 >= 97 && LA60_0 <= 98)||LA60_0==105||LA60_0==108||LA60_0==111||LA60_0==115||LA60_0==118||LA60_0==126) ) {
				alt60=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 60, 0, input);
				throw nvae;
			}

			switch (alt60) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:495:7: arrayInitializer
					{
					pushFollow(FOLLOW_arrayInitializer_in_variableInitializer1507);
					arrayInitializer();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:496:9: expression
					{
					pushFollow(FOLLOW_expression_in_variableInitializer1517);
					expression();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 44, variableInitializer_StartIndex); }

		}
	}
770880
public String getInitField(FieldData recFieldData, boolean bConstantsNotVariables, boolean bThinConstants)
    {
        boolean bConstantValue = false;
        boolean bValidThinConstant = true;
        String strInitField = recFieldData.getField(FieldData.INITIAL_VALUE).getString();
        if (strInitField != null) if (strInitField.length() > 0)
        {
            if (strInitField.charAt(0) == '\"')
                bConstantValue = true;  // This is a constant value (a string)
            if (Character.isDigit(strInitField.charAt(0)))
                bConstantValue = true;  // This is a constant value (a number)
            if ((strInitField.equalsIgnoreCase("true")) || (strInitField.equalsIgnoreCase("false")))
                bConstantValue = true;  // This is a constant value (a number)
            if (strInitField.startsWith("new "))
                bConstantValue = true;  // This is a constant value (an object)
            if (strInitField.indexOf('.') != -1)
                if (strInitField.lastIndexOf('(') <= 1) // Not found or a class cast.
                    if (!Utility.isNumeric(strInitField))
                {
                    bConstantValue = true;  // This is a constant value (a member constant - not a function call)
                    bValidThinConstant = false;
                }
        }
        if (bConstantsNotVariables != bConstantValue)
            strInitField = DBConstants.BLANK;          // Not asking for this type of value
        if (bThinConstants)
            if (!bValidThinConstant)
                strInitField = DBConstants.BLANK;          // Not asking for this type of value
        return strInitField;
    }
595336
public void init(BaseField field, Converter converterDest, Converter converterSource, boolean bFreeChainedConverters)
    {
        m_converterDest = converterDest;
        m_converterSource = converterSource;
        m_bFreeChainedConverters = bFreeChainedConverters;
        super.init(field);
    }
478810
def _init_composite_fields(self):
        
        # The base_composite_fields class attribute is the *class-wide*
        # definition of fields. Because a particular *instance* of the class
        # might want to alter self.composite_fields, we create
        # self.composite_fields here by copying base_composite_fields.
        # Instances should always modify self.composite_fields; they should not
        # modify base_composite_fields.
        self.composite_fields = copy.deepcopy(self.base_composite_fields)
        self.forms = OrderedDict()
        self.formsets = OrderedDict()
        for name, field in self.composite_fields.items():
            self._init_composite_field(name, field)
951985
public void init(BaseField field)
    {
        super.init(field);
        m_BehaviorList = new Vector<BaseListener>();
        m_dependentListener = null;
    }
1317074
def field_init(self, *args, **kwargs):
    
    humanize_func = kwargs.pop('humanized', None)
    if humanize_func:
        def humanize(val, inst, *args, **kwargs):
            return humanize_func(val, inst, field=self, *args, **kwargs)
        self.humanized = humanize
    else:
        self.humanized = self.default_humanized
    getattr(self, '_init_chamber_patch_')(*args, **kwargs)