Preventing various exception in the RemoteIndices dialog release701_base
authorJan Lahoda <jlahoda@netbeans.org>
Thu, 28 Apr 2011 20:13:40 +0200
changeset 572d9b17eac9870
parent 571 157bf9a34fa1
child 573 7b72ec7ddf14
child 574 f2010d516ba4
child 577 a89d30926467
Preventing various exception in the RemoteIndices dialog
api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.java
     1.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.java	Thu Apr 28 20:13:40 2011 +0200
     1.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.java	Thu Apr 28 20:13:40 2011 +0200
     1.3 @@ -364,6 +364,10 @@
     1.4                  checkingIndexURLError.set(ex.getLocalizedMessage());
     1.5              } catch (MalformedURLException ex) {
     1.6                  checkingIndexURLError.set(ex.getLocalizedMessage());
     1.7 +            } catch (ThreadDeath td) {
     1.8 +                throw td;
     1.9 +            } catch (Throwable t) {//#6541019
    1.10 +                checkingIndexURLError.set("Invalid URL");
    1.11              }
    1.12              
    1.13              checkingIndexURL.set(false);
    1.14 @@ -374,7 +378,7 @@
    1.15                  public void run() {
    1.16                      updateErrors();
    1.17  
    1.18 -                    if (subindicesFinal == null) return;
    1.19 +                    if (subindicesFinal == null || subindicesFinal.isEmpty()) return;
    1.20  
    1.21                      DefaultComboBoxModel model = (DefaultComboBoxModel) subIndex.getModel();
    1.22                      String selected = (String) model.getSelectedItem();
    1.23 @@ -427,7 +431,8 @@
    1.24                  String indexInfoText = WebUtilities.requestStringResponse(url.toURI().resolve("info?path=" + WebUtilities.escapeForQuery(subIndex)));
    1.25                  info = IndexInfo.empty();
    1.26  
    1.27 -                Pojson.update(info, indexInfoText);
    1.28 +                if (indexInfoText != null)
    1.29 +                    Pojson.update(info, indexInfoText);
    1.30              } catch (URISyntaxException ex) {
    1.31                  Logger.getLogger(CustomizeRemoteIndex.class.getName()).log(Level.FINE, null, ex);
    1.32              } catch (MalformedURLException ex) {