{"action":"created","comment":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments/37817743","id":37817743,"diff_hunk":"@@ -36,18 +32,16 @@\n         DiscoveryFindingServices\n     }\n \n-    private State myState = State.DiscoveryNotInitialized;\n-\n-    WifiServiceAdvertiser mWifiAccessPoint = null;\n-    WifiServiceSearcher mWifiServiceSearcher = null;\n+    private WifiServiceAdvertiser mWifiAccessPoint = null;\n+    private WifiServiceSearcher mWifiServiceSearcher = null;\n     private String mEncryptedInstance = \"\";\n \n     private Context context = null;\n-    String mSERVICE_TYPE = \"\";\n-    WifiP2pManager.Channel channel = null;\n-    WifiP2pManager p2p = null;\n+    private String mSERVICE_TYPE = \"\";\n+    private WifiP2pManager.Channel channel = null;\n+    private WifiP2pManager p2p = null;\n \n-    CountDownTimer ServiceFoundTimeOutTimer = new CountDownTimer(600000, 1000) {\n+    private final CountDownTimer ServiceFoundTimeOutTimer = new CountDownTimer(600000, 1000) {\n         public void onTick(long millisUntilFinished) {\n             // not using\n         }","path":"BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java","position":45,"original_position":45,"commit_id":"cefd0f75adca39f730be0b1934654725f9808736","original_commit_id":"cefd0f75adca39f730be0b1934654725f9808736","user":{"login":"yaronyg","id":1480964,"avatar_url":"https://avatars.githubusercontent.com/u/1480964?v=3","gravatar_id":"","url":"https://api.github.com/users/yaronyg","html_url":"https://github.com/yaronyg","followers_url":"https://api.github.com/users/yaronyg/followers","following_url":"https://api.github.com/users/yaronyg/following{/other_user}","gists_url":"https://api.github.com/users/yaronyg/gists{/gist_id}","starred_url":"https://api.github.com/users/yaronyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaronyg/subscriptions","organizations_url":"https://api.github.com/users/yaronyg/orgs","repos_url":"https://api.github.com/users/yaronyg/repos","events_url":"https://api.github.com/users/yaronyg/events{/privacy}","received_events_url":"https://api.github.com/users/yaronyg/received_events","type":"User","site_admin":false},"body":"Usual whining on lines 59-64 about values that can be final.","created_at":"2015-08-24T23:32:40Z","updated_at":"2015-08-24T23:32:40Z","html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817743","pull_request_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments/37817743"},"html":{"href":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817743"},"pull_request":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6","id":42822624,"html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6","diff_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6.diff","patch_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6.patch","issue_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6","number":6,"state":"open","locked":false,"title":"Story 0 juksilve","user":{"login":"DrJukka","id":5235141,"avatar_url":"https://avatars.githubusercontent.com/u/5235141?v=3","gravatar_id":"","url":"https://api.github.com/users/DrJukka","html_url":"https://github.com/DrJukka","followers_url":"https://api.github.com/users/DrJukka/followers","following_url":"https://api.github.com/users/DrJukka/following{/other_user}","gists_url":"https://api.github.com/users/DrJukka/gists{/gist_id}","starred_url":"https://api.github.com/users/DrJukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrJukka/subscriptions","organizations_url":"https://api.github.com/users/DrJukka/orgs","repos_url":"https://api.github.com/users/DrJukka/repos","events_url":"https://api.github.com/users/DrJukka/events{/privacy}","received_events_url":"https://api.github.com/users/DrJukka/received_events","type":"User","site_admin":false},"body":"latest changes to be merged with library\n<a href='#crh-start'></a><a href='#crh-data-%7B%22processed%22%3A%20%5B%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134403551%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134403946%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134404138%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814628%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814752%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814918%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815070%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815253%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815335%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815876%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816037%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816150%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816305%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816440%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816616%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816721%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816761%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816869%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816909%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817105%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817238%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817544%22%2C%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817676%22%5D%2C%20%22comments%22%3A%20%7B%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23issuecomment-134403551%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20remove%20all%20.iml%20files%20they%20should%20not%20be%20checked%20in.%20In%20order%20to%20support%20properly%20keeping%20all%20critical%20state%20in%20build.gradle%20so%20we%20have%20repeatable%20and%20consistent%20builds%20we%20should%20only%20be%20checking%20in%20the%20build.gradle%20and%20not%20the%20.iml%20files.%20Please%20also%20edit%20.gitignore%20so%20it%20ignores%20all%20.iml%20files.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A46%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22Why%20is%20the%20app%20sub-project%20part%20of%20BtConnectorLib%3F%20It%20doesn%27t%20have%20any%20code.%20Can%20we%20please%20just%20delete%20it%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A48%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22I%20can%20see%20code%20that%20catches%20Exception.%20Per%20my%20previous%20PR%20please%20remove%20all%20attempts%20to%20catch%20the%20Exception%20object%20and%20replace%20it%20with%20a%20more%20targeted%20catch.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A49%3A11Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20246%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816909%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22And%20shouldn%27t%20there%20be%20a%20check%20that%20startServices%20was%20called%20before%20stopServices%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A20%3A37Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL182-207%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%2061%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817238%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Usual%20whining%20about%20these%20values%20being%20setable%20in%20most%20cases%20to%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A25%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%3AL5-151%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2035%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814628%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Context%20and%20callBack%20can%20both%20be%20final.%20Please%20make%20them%20so.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A49%3A55Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL3-30%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%20147%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815876%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22/BtBrowdCastReceiver/BtBroadCastReceiver/%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A05%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL92-111%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20139%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816440%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22/untill/until/%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A13%3A14Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20251%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817105%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22We%20need%20to%20get%20consistent%20on%20how%20we%20log.%20Some%20places%20there%20is%20print_debug%20and%20other%20places%20are%20print_line.%20What%20we%20really%20need%20to%20do%20is%20to%20just%20use%20the%20Android%20logging%20API.%20Then%20we%20can%20set%20the%20log%20levels%20anyway%20we%20want.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A23%3A22Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL182-207%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20221%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816869%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20there%20be%20a%20check%20that%20start%20was%20called%20first%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A19%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2078%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816305%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Every%20single%20variable%20set%20in%20this%20constructor%20can%20be%20safely%20set%20to%20final.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A11%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL43-81%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2024%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816037%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22It%20is%20much%20cleaner%20and%20safe%20to%20make%20all%20the%20member%20variables%20final%20and%20require%20their%20settings%20to%20be%20passed%20into%20the%20constructor.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A07%3A26Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL5-24%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java%2011%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817676%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20this%20inherit%20from%20ConnectSelector%20in%20BTConnector%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A31%3A40Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java%3AL16-28%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20203%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816721%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22I%20believe%20you%20are%20saying%20that%20someone%20called%20tryConnect%20without%20a%20successful%20call%20to%20start.%20In%20that%20case%20shouldn%27t%20we%20throw%20an%20exception%3F%20Otherwise%20how%20can%20the%20dev%20tell%20the%20difference%20between%20having%20screwed%20up%20and%20called%20TryConnect%20without%20start%20and%20having%20called%20for%20the%20wrong%20peerAddress%20%28the%20next%20usage%20of%20this%20same%20response%20code%29%3F%20This%20really%20should%20be%2C%20I%20believe%2C%20an%20exception.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A17%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2084%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816616%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Both%20the%20start%20and%20stop%20methods%20seem%20like%20the%20kind%20of%20methods%20that%20should%20be%20called%20exactly%20once%20apiece.%20Once%20stop%20is%20called%20shouldn%27t%20the%20BTConnector%20object%20be%20garbage%20collected%20and%20a%20new%20one%20created%3F%20This%20would%20make%20the%20logic%20much%20simpler.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A16%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL43-81%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%20211%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816761%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20see%20my%20comment%20on%20line%20162.%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A18%3A13Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL86-181%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2042%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814752%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20remove%20blueAddress%20and%20instead%20please%20make%20getAddress%20into%20an%20accessor%20that%20calls%20bluetooth.getAddress%28%29%20directly.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A51%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2047%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815253%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20we%20throw%20if%20Start%28%29%20is%20called%20multiple%20times%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A57%3A30Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2041%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37814918%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22If%20bluetooth%20is%20null%20then%20the%20class%20instance%20is%20useless.%20Please%20test%20and%20throw.%20This%20will%2C%20btw%2C%20let%20you%20remove%20all%20the%20tests%20for%20bluetooth%20%3D%3D%20null%20everywhere%20else%20in%20this%20class%20since%20you%20know%20if%20the%20object%20exists%20then%20then%20bluetooth%20isn%27t%20null.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A53%3A12Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%2C%20%7B%22body%22%3A%20%22BTW%2C%20just%20to%20be%20fair%2C%20there%20is%20a%20pretty%20strong%20school%20of%20thought%20that%20argues%20that%20constructors%20shouldn%27t%20throw.%20It%20makes%20declaring%20variables%20tricky%20and%20can%20be%20a%20bit%20surprising%20since%20typically%20constructors%20shouldn%27t%20do%20anything.%20Instead%20someone%20should%20have%20to%20call%20a%20method%20on%20the%20object%20before%20anything%20interesting%20happens.%20I%20have%20a%20lot%20of%20sympathy%20for%20this%20later%20view.%20But%20in%20that%20case%20Start%20should%20definitely%20throw%20if%20bluetooth%20is%20null.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A55%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%2030%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37817544%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Why%20is%20this%20defined%20at%20all%3F%20Shouldn%27t%20it%20just%20be%20the%20Callback%20interface%20from%20BTConnector%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A29%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java%3AL5-151%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%2029%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37816150%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22The%20name%20%5C%22Callback%5C%22%20is%20more%20than%20a%20little%20generic%20and%20makes%20it%20had%20to%20follow%20the%20code%20when%20it%20is%20used%20outside%20of%20this%20class%2C%20such%20as%20in%20BtConnectorHelper.%20How%20about%20a%20more%20descriptive%20name%20like%20BTConnectorCallback%3F%22%2C%20%22created_at%22%3A%20%222015-08-24T23%3A08%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java%3AL43-81%22%7D%2C%20%22Pull%20cefd0f75adca39f730be0b1934654725f9808736%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%2069%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6%23discussion_r37815335%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Other%20than%20the%20usual%20comment%20about%20never%20catching%20Exception%2C%20isn%27t%20it%20bad%20that%20we%20are%20just%20swallowing%20this%20exception%3F%20This%20seems%20like%20the%20kind%20of%20thing%20that%20should%20cause%20a%20throw%20from%20Start%28%29%20so%20the%20caller%20knows%20they%20are%20in%20a%20really%20bad%20place.%22%2C%20%22created_at%22%3A%20%222015-08-24T22%3A58%3A27Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1480964%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/yaronyg%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java%3AL31-89%22%7D%7D%7D'></a>\n<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>\n- [ ] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#issuecomment-134403551'>General Comment</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please remove all .iml files they should not be checked in. In order to support properly keeping all critical state in build.gradle so we have repeatable and consistent builds we should only be checking in the build.gradle and not the .iml files. Please also edit .gitignore so it ignores all .iml files.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Why is the app sub-project part of BtConnectorLib? It doesn't have any code. Can we please just delete it?\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> I can see code that catches Exception. Per my previous PR please remove all attempts to catch the Exception object and replace it with a more targeted catch.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 35'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37814628'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L3-30</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Context and callBack can both be final. Please make them so.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 42'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37814752'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please remove blueAddress and instead please make getAddress into an accessor that calls bluetooth.getAddress() directly.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 41'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37814918'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> If bluetooth is null then the class instance is useless. Please test and throw. This will, btw, let you remove all the tests for bluetooth == null everywhere else in this class since you know if the object exists then then bluetooth isn't null.\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> BTW, just to be fair, there is a pretty strong school of thought that argues that constructors shouldn't throw. It makes declaring variables tricky and can be a bit surprising since typically constructors shouldn't do anything. Instead someone should have to call a method on the object before anything interesting happens. I have a lot of sympathy for this later view. But in that case Start should definitely throw if bluetooth is null.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 47'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37815253'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Shouldn't we throw if Start() is called multiple times?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 69'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37815335'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L31-89</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Other than the usual comment about never catching Exception, isn't it bad that we are just swallowing this exception? This seems like the kind of thing that should cause a throw from Start() so the caller knows they are in a really bad place.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java 147'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37815876'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BluetoothBase.java:L92-111</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> /BtBrowdCastReceiver/BtBroadCastReceiver/\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 24'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816037'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L5-24</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> It is much cleaner and safe to make all the member variables final and require their settings to be passed into the constructor.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 29'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816150'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L43-81</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> The name \"Callback\" is more than a little generic and makes it had to follow the code when it is used outside of this class, such as in BtConnectorHelper. How about a more descriptive name like BTConnectorCallback?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 78'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816305'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L43-81</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Every single variable set in this constructor can be safely set to final.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 139'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816440'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> /untill/until/\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 84'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816616'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L43-81</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Both the start and stop methods seem like the kind of methods that should be called exactly once apiece. Once stop is called shouldn't the BTConnector object be garbage collected and a new one created? This would make the logic much simpler.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 203'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816721'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> I believe you are saying that someone called tryConnect without a successful call to start. In that case shouldn't we throw an exception? Otherwise how can the dev tell the difference between having screwed up and called TryConnect without start and having called for the wrong peerAddress (the next usage of this same response code)? This really should be, I believe, an exception.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 211'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816761'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Please see my comment on line 162.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 221'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816869'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L86-181</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Shouldn't there be a check that start was called first?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 246'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37816909'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L182-207</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> And shouldn't there be a check that startServices was called before stopServices?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java 251'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817105'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector.java:L182-207</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> We need to get consistent on how we log. Some places there is print_debug and other places are print_line. What we really need to do is to just use the Android logging API. Then we can set the log levels anyway we want.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java 61'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817238'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java:L5-151</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Usual whining about these values being setable in most cases to final.\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java 30'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817544'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_BtConnection.java:L5-151</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Why is this defined at all? Shouldn't it just be the Callback interface from BTConnector?\n- [ ] <a href='#crh-comment-Pull cefd0f75adca39f730be0b1934654725f9808736 BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java 11'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6#discussion_r37817676'>File: BtConnectorLib/btconnectorlib2/src/main/java/org/thaliproject/p2p/btconnectorlib/BTConnector_Discovery.java:L16-28</a></b>\n- <a href='https://github.com/yaronyg'><img border=0 src='https://avatars.githubusercontent.com/u/1480964?v=3' height=16 width=16'></a> Shouldn't this inherit from ConnectSelector in BTConnector?\n\n\n<a href='https://www.codereviewhub.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>\n<a href='#crh-end'></a>","created_at":"2015-08-19T14:43:01Z","updated_at":"2015-08-24T23:32:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c01db01ce24ab137c0d4194771086a1ed2e9db7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/commits","review_comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/comments","review_comment_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6/comments","statuses_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/cefd0f75adca39f730be0b1934654725f9808736","head":{"label":"thaliproject:story_0_juksilve","ref":"story_0_juksilve","sha":"cefd0f75adca39f730be0b1934654725f9808736","user":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"repo":{"id":37128954,"name":"Thali_CordovaPlugin_BtLibrary","full_name":"thaliproject/Thali_CordovaPlugin_BtLibrary","owner":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","description":"the plug-in needed for the Thali CordovaPlugin's android implementation","fork":false,"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary","forks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/forks","keys_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/teams","hooks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/hooks","issue_events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/events{/number}","events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/events","assignees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/assignees{/user}","branches_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/branches{/branch}","tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/tags","blobs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/refs{/sha}","trees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/{sha}","languages_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/languages","stargazers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/stargazers","contributors_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contributors","subscribers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscribers","subscription_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscription","commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/commits{/sha}","git_commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/commits{/sha}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/comments{/number}","issue_comment_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/comments{/number}","contents_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contents/{+path}","compare_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/merges","archive_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/downloads","issues_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues{/number}","pulls_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls{/number}","milestones_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/milestones{/number}","notifications_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/labels{/name}","releases_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/releases{/id}","created_at":"2015-06-09T11:51:53Z","updated_at":"2015-06-09T11:57:41Z","pushed_at":"2015-08-20T19:18:11Z","git_url":"git://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","ssh_url":"git@github.com:thaliproject/Thali_CordovaPlugin_BtLibrary.git","clone_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","svn_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","homepage":null,"size":542,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"thaliproject:master","ref":"master","sha":"8e8849cb7e1783661cebe06b15a2e8f826b04066","user":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"repo":{"id":37128954,"name":"Thali_CordovaPlugin_BtLibrary","full_name":"thaliproject/Thali_CordovaPlugin_BtLibrary","owner":{"login":"thaliproject","id":7918300,"avatar_url":"https://avatars.githubusercontent.com/u/7918300?v=3","gravatar_id":"","url":"https://api.github.com/users/thaliproject","html_url":"https://github.com/thaliproject","followers_url":"https://api.github.com/users/thaliproject/followers","following_url":"https://api.github.com/users/thaliproject/following{/other_user}","gists_url":"https://api.github.com/users/thaliproject/gists{/gist_id}","starred_url":"https://api.github.com/users/thaliproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaliproject/subscriptions","organizations_url":"https://api.github.com/users/thaliproject/orgs","repos_url":"https://api.github.com/users/thaliproject/repos","events_url":"https://api.github.com/users/thaliproject/events{/privacy}","received_events_url":"https://api.github.com/users/thaliproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","description":"the plug-in needed for the Thali CordovaPlugin's android implementation","fork":false,"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary","forks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/forks","keys_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/teams","hooks_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/hooks","issue_events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/events{/number}","events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/events","assignees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/assignees{/user}","branches_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/branches{/branch}","tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/tags","blobs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/refs{/sha}","trees_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/{sha}","languages_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/languages","stargazers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/stargazers","contributors_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contributors","subscribers_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscribers","subscription_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/subscription","commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/commits{/sha}","git_commits_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/git/commits{/sha}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/comments{/number}","issue_comment_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/comments{/number}","contents_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/contents/{+path}","compare_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/merges","archive_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/downloads","issues_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues{/number}","pulls_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls{/number}","milestones_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/milestones{/number}","notifications_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/labels{/name}","releases_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/releases{/id}","created_at":"2015-06-09T11:51:53Z","updated_at":"2015-06-09T11:57:41Z","pushed_at":"2015-08-20T19:18:11Z","git_url":"git://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","ssh_url":"git@github.com:thaliproject/Thali_CordovaPlugin_BtLibrary.git","clone_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary.git","svn_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary","homepage":null,"size":542,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6"},"html":{"href":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/6"},"issue":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6"},"comments":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/statuses/cefd0f75adca39f730be0b1934654725f9808736"}}}}