Search in sources :

Example 1 with PlgInfo

use of platformSpecific.fakeInternet.PluginWithPart.PlgInfo in project L42 by ElvisResearchGroup.

the class PlgWrapperGenerator method plgComplete1.

public static ClassB plgComplete1(List<Ast.C> cs, Program p, ClassB l) throws UnresolvedOverloading, ClassUnfit, MethodUnfit {
    PluginWithPart pwp = OnLineCode._isPluginWithPart(l.getDoc1());
    if (pwp == null) {
        return l;
    }
    PlgInfo plgInfo = new PlgInfo(l.getDoc1());
    if (!hasPluginUnresponsive(l)) {
        throw new RefactorErrors.ClassUnfit().msg("Class " + Path.outer(0, cs) + " does not contain method #pluginUnresponsive(binaryRepr)");
    }
    Class<?> c = pwp.pointed;
    Method[] jms = c.getMethods();
    Constructor<?>[] jcs = c.getDeclaredConstructors();
    List<Member> msResult = new ArrayList<>(templateWrapper);
    Path pTop = Path.outer(0, cs);
    for (Member m : l.getMs()) {
        if (!(m instanceof MethodWithType)) {
            msResult.add(m);
            continue;
        }
        MethodWithType mwt = (MethodWithType) m;
        if (mwt.get_inner().isPresent()) {
            msResult.add(mwt);
            continue;
        }
        addMwt(p, plgInfo, jms, jcs, msResult, pTop, mwt);
    }
    return l.withMs(msResult);
}
Also used : Path(ast.Ast.Path) Constructor(java.lang.reflect.Constructor) ArrayList(java.util.ArrayList) ClassUnfit(is.L42.connected.withSafeOperators.pluginWrapper.RefactorErrors.ClassUnfit) Method(java.lang.reflect.Method) MethodWithType(ast.ExpCore.ClassB.MethodWithType) PlgInfo(platformSpecific.fakeInternet.PluginWithPart.PlgInfo) PluginWithPart(platformSpecific.fakeInternet.PluginWithPart) Member(ast.ExpCore.ClassB.Member)

Aggregations

Path (ast.Ast.Path)1 Member (ast.ExpCore.ClassB.Member)1 MethodWithType (ast.ExpCore.ClassB.MethodWithType)1 ClassUnfit (is.L42.connected.withSafeOperators.pluginWrapper.RefactorErrors.ClassUnfit)1 Constructor (java.lang.reflect.Constructor)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 PluginWithPart (platformSpecific.fakeInternet.PluginWithPart)1 PlgInfo (platformSpecific.fakeInternet.PluginWithPart.PlgInfo)1