{"action":"created","issue":{"url":"https://api.github.com/repos/vojtechhabarta/typescript-generator/issues/283","repository_url":"https://api.github.com/repos/vojtechhabarta/typescript-generator","labels_url":"https://api.github.com/repos/vojtechhabarta/typescript-generator/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/vojtechhabarta/typescript-generator/issues/283/comments","events_url":"https://api.github.com/repos/vojtechhabarta/typescript-generator/issues/283/events","html_url":"https://github.com/vojtechhabarta/typescript-generator/issues/283","id":373499190,"node_id":"MDU6SXNzdWUzNzM0OTkxOTA=","number":283,"title":"\"Multiple classes are mapped to the same name\" error occurring for the same class","user":{"login":"antch","id":4552169,"node_id":"MDQ6VXNlcjQ1NTIxNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/4552169?v=4","gravatar_id":"","url":"https://api.github.com/users/antch","html_url":"https://github.com/antch","followers_url":"https://api.github.com/users/antch/followers","following_url":"https://api.github.com/users/antch/following{/other_user}","gists_url":"https://api.github.com/users/antch/gists{/gist_id}","starred_url":"https://api.github.com/users/antch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antch/subscriptions","organizations_url":"https://api.github.com/users/antch/orgs","repos_url":"https://api.github.com/users/antch/repos","events_url":"https://api.github.com/users/antch/events{/privacy}","received_events_url":"https://api.github.com/users/antch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-24T14:01:18Z","updated_at":"2018-10-24T16:42:17Z","closed_at":null,"author_association":"NONE","body":"I'm trying to use typescript-generator to generate a .ts.d file for a set of ~300 classes via custom Ant task. In my case I want all subclasses of a specific class so I'm using ClassGraph to load all of the classes and then using `Input.from(Type...)`. I'm also using `mapPackagesToNamespaces` for now to get past some of the same-class-difference-packages naming conflicts.\r\n\r\nUnfortunately I am still receiving the error:\r\n\r\n    cz.habarta.typescript.generator.compiler.SymbolTable$NameConflictException: Multiple classes are mapped to the same name. You can use 'customTypeNaming' or 'customTypeNamingFunction' settings to resolve conflicts or exclude conflicting class if it was added accidentally.\r\n        at cz.habarta.typescript.generator.compiler.SymbolTable.reportConflicts(SymbolTable.java:108)\r\n\r\nI have debug logging on and can see all of the \"Parsing...\" messages (around 1900 of them), followed by the warning:\r\n\r\n    [typescript-generator] Warning: Multiple classes are mapped to 'com.mypackage.ComponentProjection' name. Conflicting classes: [interface com.mypackage.ComponentProjection, interface com.mypackage.ComponentProjection]\r\n\r\nNote that the packages are the same -- there is only one class defined with that name. Is there any way to effectively troubleshoot an issue like this? `com.mypackage.ComponentProjection` itself is not generic, though it is used as a type parameter in a few of the other applicable classes."},"comment":{"url":"https://api.github.com/repos/vojtechhabarta/typescript-generator/issues/comments/432734655","html_url":"https://github.com/vojtechhabarta/typescript-generator/issues/283#issuecomment-432734655","issue_url":"https://api.github.com/repos/vojtechhabarta/typescript-generator/issues/283","id":432734655,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjczNDY1NQ==","user":{"login":"vojtechhabarta","id":1191407,"node_id":"MDQ6VXNlcjExOTE0MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1191407?v=4","gravatar_id":"","url":"https://api.github.com/users/vojtechhabarta","html_url":"https://github.com/vojtechhabarta","followers_url":"https://api.github.com/users/vojtechhabarta/followers","following_url":"https://api.github.com/users/vojtechhabarta/following{/other_user}","gists_url":"https://api.github.com/users/vojtechhabarta/gists{/gist_id}","starred_url":"https://api.github.com/users/vojtechhabarta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vojtechhabarta/subscriptions","organizations_url":"https://api.github.com/users/vojtechhabarta/orgs","repos_url":"https://api.github.com/users/vojtechhabarta/repos","events_url":"https://api.github.com/users/vojtechhabarta/events{/privacy}","received_events_url":"https://api.github.com/users/vojtechhabarta/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T16:42:17Z","updated_at":"2018-10-24T16:42:17Z","author_association":"OWNER","body":"I really don't know.\r\n\r\nName conflicts are handled in [SymbolTable](https://github.com/vojtechhabarta/typescript-generator/blob/master/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/compiler/SymbolTable.java) class. You can check if there is something suspicious. There is `symbols` field which is `Map` which key is `Pair` of class and suffix. So this `Map`, I think, cannot contain same class twice (same class with two different suffixes produces different non-conflicting names). So I still don't know what could be the reason other than multiple classloaders.\r\n\r\nIf you are willing to build typescript-generator from sources you can also try to confirm or deny that this class is loaded by two classloaders. In this case change how list of confilicting classes is logged  on this line: https://github.com/vojtechhabarta/typescript-generator/blob/2aa0a89a19383d929cb19c94fe653d443a1baaa4/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/compiler/SymbolTable.java#L103 Put there for example `classes.stream().map(cls -> cls.getName() + \" from \" + cls.getClassLoader()).collect(Collectors.toList())`."}}
{"actor":{"display_login":"vojtechhabarta"}}