checkADupFieldName(localNames, streamNames, func.getName(), func.getContext());
String name = func.getName(); if (name == null) { switch(func.getCls()) { case Function.FUNC_INIT: name = "init"; break; case Function.FUNC_WORK: name = "work"; break; case Function.FUNC_PREWORK: name = "prework"; break; case Function.FUNC_HANDLER: report(func, "message handlers must have names"); break; case Function.FUNC_HELPER: report(func, "helper functions must have names"); break; case Function.FUNC_PHASE: report(func, "phase functions must have names"); break; default:  } } if (name != null) checkADupFieldName(localNames, streamNames, name, func.getContext());
    public void checkDupFieldNames(Program prog, Map streamNames)    {        for (Iterator iter = prog.getStreams().iterator(); iter.hasNext(); )        {            StreamSpec spec = (StreamSpec)iter.next();            Map localNames = new HashMap();            Iterator i2;            for (i2 = spec.getParams().iterator(); i2.hasNext(); )            {                Parameter param = (Parameter)i2.next();                checkADupFieldName(localNames, streamNames,                                   param.getName(), spec.getContext());            }            for (i2 = spec.getVars().iterator(); i2.hasNext(); )            {                FieldDecl field = (FieldDecl)i2.next();                for (int i = 0; i < field.getNumFields(); i++)                    checkADupFieldName(localNames, streamNames,                                       field.getName(i), field.getContext());            }            for (i2 = spec.getFuncs().iterator(); i2.hasNext(); )            {                Function func = (Function)i2.next();                checkADupFieldName(localNames, streamNames,                                   func.getName(), func.getContext());            }        }        for (Iterator iter = prog.getStructs().iterator(); iter.hasNext(); )        {            TypeStruct ts = (TypeStruct)iter.next();            Map localNames = new HashMap();            for (int i = 0; i < ts.getNumFields(); i++)                checkADupFieldName(localNames, streamNames,                                   ts.getField(i), ts.getContext());        }    }