title: Why is my java method called twice?
body: <p>this is the code called twice:</p>
  
  <pre><code>    public static DefaultListModel getFriends(int nameOrUser) {
      try {
          Friend[] allFriends = Skype.getContactList().getAllFriends();
  
          System.out.println("Skype contact list lenght: " + allFriends.length);
  
          for (Friend friend : allFriends) {
              String fullName = friend.getFullName();
              String userName = friend.toString();
              if (fullName.isEmpty()) {
                  fullName = friend.getId();
              }
              fullListModel.addElement(fullName);
              userListModel.addElement(userName);
          }
      } catch (SkypeException ex) {
          Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
      }
      if (nameOrUser == 0) {
          return fullListModel;
      } else if (nameOrUser == 1) {
          return userListModel;
      } else {
          System.out.println("You must specify a valid data type.");
      }
  
      return null;
  }
  </code></pre>
  
  <p>The problem is that when I assign that to a jList, the jList contains the contact list twice :/</p>
  
  <p>Hope I explained it well and sorry if my english was bad.</p>
  
  <p>EDIT:</p>
  
  <p>Here's the calling code:</p>
  
  <pre><code>fullList.setModel(Utils.getFriends(0));
  </code></pre>