8190475: SwingSet2 won't start

Reviewed-by: serb
This commit is contained in:
Phil Race 2017-11-01 10:43:44 -07:00
parent aa96056b21
commit f900a5f39b
2 changed files with 1 additions and 143 deletions

View file

@ -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 @@ public class DefaultListSelectionModel implements ListSelectionModel, Cloneable,
* @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 @@ public class DefaultListSelectionModel implements ListSelectionModel, Cloneable,
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} */