Bug 152691 - Added guard to prevent OOB exception
authorLou Dasaro <mr_lou_d@netbeans.org>
Sun, 24 May 2015 23:34:18 -0500
changeset 18270d1679e74e1cb
parent 18269 aa006f2ab6a9
child 18271 7bbf4abf1a5c
Bug 152691 - Added guard to prevent OOB exception
python.core/src/org/netbeans/modules/python/core/ui/models/PathListModel.java
     1.1 --- a/python.core/src/org/netbeans/modules/python/core/ui/models/PathListModel.java	Sun May 10 23:44:07 2015 -0700
     1.2 +++ b/python.core/src/org/netbeans/modules/python/core/ui/models/PathListModel.java	Sun May 24 23:34:18 2015 -0500
     1.3 @@ -53,7 +53,7 @@
     1.4          }
     1.5      }
     1.6      public void moveDown(int index){
     1.7 -        if (index < model.size()){
     1.8 +        if (index +1 < model.size()){ // +1 because you can't move 'down' from the end position!
     1.9              String temp = model.remove(index);
    1.10              model.add(index+1, temp);
    1.11              fireContentsChanged(this, 0, model.size() -1);