{"action":"created","issue":{"url":"https://api.github.com/repos/cincheo/jsweet/issues/207","repository_url":"https://api.github.com/repos/cincheo/jsweet","labels_url":"https://api.github.com/repos/cincheo/jsweet/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/cincheo/jsweet/issues/207/comments","events_url":"https://api.github.com/repos/cincheo/jsweet/issues/207/events","html_url":"https://github.com/cincheo/jsweet/issues/207","id":200776316,"number":207,"title":"un-wanted package prefix added","user":{"login":"lancemao","id":5020396,"avatar_url":"https://avatars.githubusercontent.com/u/5020396?v=3","gravatar_id":"","url":"https://api.github.com/users/lancemao","html_url":"https://github.com/lancemao","followers_url":"https://api.github.com/users/lancemao/followers","following_url":"https://api.github.com/users/lancemao/following{/other_user}","gists_url":"https://api.github.com/users/lancemao/gists{/gist_id}","starred_url":"https://api.github.com/users/lancemao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lancemao/subscriptions","organizations_url":"https://api.github.com/users/lancemao/orgs","repos_url":"https://api.github.com/users/lancemao/repos","events_url":"https://api.github.com/users/lancemao/events{/privacy}","received_events_url":"https://api.github.com/users/lancemao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-01-14T03:11:49Z","updated_at":"2017-01-25T00:59:18Z","closed_at":null,"body":"Hey guys,\r\n\r\nimagine we have business Java code which is in package:\r\ncom.mycompany.java (the key is the unusual 'java' folder)\r\nand we have somehow injected java.io.FileInputStream class into our JSEngine\r\n\r\nwhen using our FileInputStream, we clearly imported:\r\nimport java.io.FileInputStream;\r\nwe didn't import com.mycompany.java.io.FileInputStream\r\n\r\nthe bug happens when we run JSweet to convert our Java to JS which added un-wanted package prefix before java.io.FileInputStream, i.e.\r\nmycompany.java.io.FileInputStream\r\n\r\nwe believe this happens because as jsweet searches com.mycompany, and found 'java' is a sub folder under mycompany, so it assumes any class under java should be under mycompany, which in most cases is correct except when someone injected 'java' before converting business code\r\n\r\nHope the community take a look at this issue ASAP since our life and career depends on this awesome tool. we have somehow 'proved' to our boss that jsweet is our best ally on his next huge project"},"comment":{"url":"https://api.github.com/repos/cincheo/jsweet/issues/comments/274988592","html_url":"https://github.com/cincheo/jsweet/issues/207#issuecomment-274988592","issue_url":"https://api.github.com/repos/cincheo/jsweet/issues/207","id":274988592,"user":{"login":"lancemao","id":5020396,"avatar_url":"https://avatars.githubusercontent.com/u/5020396?v=3","gravatar_id":"","url":"https://api.github.com/users/lancemao","html_url":"https://github.com/lancemao","followers_url":"https://api.github.com/users/lancemao/followers","following_url":"https://api.github.com/users/lancemao/following{/other_user}","gists_url":"https://api.github.com/users/lancemao/gists{/gist_id}","starred_url":"https://api.github.com/users/lancemao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lancemao/subscriptions","organizations_url":"https://api.github.com/users/lancemao/orgs","repos_url":"https://api.github.com/users/lancemao/repos","events_url":"https://api.github.com/users/lancemao/events{/privacy}","received_events_url":"https://api.github.com/users/lancemao/received_events","type":"User","site_admin":false},"created_at":"2017-01-25T00:59:17Z","updated_at":"2017-01-25T00:59:17Z","body":"At first, we transpile Java into very plain Javascript code, no TS, no commonJS. After play with the parameters, we found out two interesting modes:\r\n```\r\n1. transpiler.setModuleKind(ModuleKind.commonjs); // fix our problem and boost performance\r\n2. transpiler.setBundle(true); // problem still exists\r\n```\r\n\r\nI think we will head to option 1. And thank you very much for your support. We are very confident that JSweet will do the trick"}}
{"actor":{"display_login":"lancemao"}}