--- old/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java 2017-11-01 10:22:24.952626498 -0700 +++ new/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java 2017-11-01 10:22:24.816626501 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,6 @@ * @throws IllegalArgumentException {@inheritDoc} */ public void setSelectionMode(int selectionMode) { - int oldMode = this.selectionMode; switch (selectionMode) { case SINGLE_SELECTION: case SINGLE_INTERVAL_SELECTION: @@ -105,24 +104,6 @@ default: throw new IllegalArgumentException("invalid selectionMode"); } - - /* - This code will only be executed when selection needs to be updated on - changing selection mode. It will happen only if selection mode is changed - from MULTIPLE_INTERVAL to SINGLE_INTERVAL or SINGLE or from - SINGLE_INTERVAL to SINGLE - */ - if (oldMode > this.selectionMode) { - if (this.selectionMode == SINGLE_SELECTION) { - setSelectionInterval(minIndex, minIndex); - } else if (this.selectionMode == SINGLE_INTERVAL_SELECTION) { - int selectionEndindex = minIndex; - while (value.get(selectionEndindex+1)) { - selectionEndindex++; - } - setSelectionInterval(minIndex, selectionEndindex); - } - } } /** {@inheritDoc} */