docs: public static String resolveType(String klass,
                                       PackageDescr packageDescr,
                                       PackageRegistry pkgRegistry) {
  
          String arraySuffix = "";
          int arrayIndex = klass.indexOf("[");
          if (arrayIndex >= 0) {
              arraySuffix = klass.substring(arrayIndex);
              klass = klass.substring(0, arrayIndex);
          }
  
          //look among imports
          String temp = klass;
          while (temp.length() > 0) {
              for (ImportDescr id : packageDescr.getImports()) {
                  String fqKlass = id.getTarget();
                  if (fqKlass.endsWith("." + temp)) {
                      //logger.info("Replace supertype " + sup + " with full name " + id.getTarget());
                      fqKlass = fqKlass.substring(0, fqKlass.lastIndexOf(temp)) + klass;
                      return arrayIndex < 0 ? fqKlass : fqKlass + arraySuffix;
                  }
              }
              temp = temp.substring(0, Math.max(0, temp.lastIndexOf('.')));
          }
  
          //look among local declarations
          if (pkgRegistry != null) {
              for (String declaredName : pkgRegistry.getPackage().getTypeDeclarations().keySet()) {
                  if (declaredName.equals(klass)) {
                      TypeDeclaration typeDeclaration = pkgRegistry.getPackage().getTypeDeclaration(declaredName);
                      if (typeDeclaration.getTypeClass() != null) {
                          klass = typeDeclaration.getTypeClass().getName();
                      }
                  }
              }
          }
  
          if ((klass != null) && (!klass.contains(".")) && (packageDescr.getNamespace() != null && !packageDescr.getNamespace().isEmpty())) {
              for (AbstractClassTypeDeclarationDescr td : packageDescr.getClassAndEnumDeclarationDescrs()) {
                  if (klass.equals(td.getTypeName())) {
                      if (td.getType().getFullName().contains(".")) {
                          klass = td.getType().getFullName();
                      }
                  }
              }
          }
  
          return arrayIndex < 0 ? klass : klass + arraySuffix;
      }