iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceRepository.java
private InterfaceDefImpl addInterface(InterfaceAnalysis ia)
            throws RMIIIOPViolationException, IRConstructionException {
        InterfaceDefImpl iDef;
        Class cls = ia.getCls();

        // Lookup: Has it already been added?
        iDef = (InterfaceDefImpl) interfaceMap.get(cls);
        if (iDef != null)
            return iDef; // Yes, just return it.

        // Get module to add interface to.
        ModuleDefImpl m = ensurePackageExists(cls.getPackage().getName());

        // Add superinterfaces
        String[] base_interfaces = addInterfaces(ia);

        // Create the interface
        String base = cls.getName();
        base = base.substring(base.lastIndexOf('.') + 1);
        base = Util.javaToIDLName(base);

        iDef = new InterfaceDefImpl(ia.getRepositoryId(),
                base, "1.0", m,
                base_interfaces, impl);
        addTypeCode(cls, iDef.type());
        m.add(base, iDef);
        interfaceMap.put(cls, iDef); // Remember we mapped this.

        // Fill in constants
        addConstants(iDef, ia);

        // Add attributes
        addAttributes(iDef, ia);

        // Fill in operations
        addOperations(iDef, ia);

        return iDef;
    }
private InterfaceDefImpl addInterface(InterfaceAnalysis ia)
            throws RMIIIOPViolationException, IRConstructionException {
        InterfaceDefImpl iDef;
        Class cls = ia.getCls();

        // Lookup: Has it already been added?
        iDef = (InterfaceDefImpl) interfaceMap.get(cls);
        if (iDef != null)
            return iDef; // Yes, just return it.

        // Get module to add interface to.
        ModuleDefImpl m = ensurePackageExists(cls.getPackage().getName());

        // Add superinterfaces
        String[] base_interfaces = addInterfaces(ia);

        // Create the interface
        String base = cls.getName();
        base = base.substring(base.lastIndexOf('.') + 1);
        base = Util.javaToIDLName(base);

        iDef = new InterfaceDefImpl(ia.getRepositoryId(),
                base, "1.0", m,
                base_interfaces, impl);
        addTypeCode(cls, iDef.type());
        m.add(base, iDef);
        interfaceMap.put(cls, iDef); // Remember we mapped this.

        // Fill in constants
        addConstants(iDef, ia);

        // Add attributes
        addAttributes(iDef, ia);

        // Fill in operations
        addOperations(iDef, ia);

        return iDef;
    }
Add an interface.