Skip to content

Commit

Permalink
8299986: Wrong sublist used in ListChangeListener
Browse files Browse the repository at this point in the history
Reviewed-by: kcr
  • Loading branch information
Andy Goryachev committed Feb 10, 2023
1 parent d3654e3 commit 55eb83d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, 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
Expand Down Expand Up @@ -277,7 +277,7 @@ public void changed(ObservableValue<? extends Boolean> observable, Boolean oldVa
tp.focusedProperty().addListener(paneFocusListener);
}
} else if (c.wasRemoved()) {
for (final TitledPane tp: c.getAddedSubList()) {
for (final TitledPane tp: c.getRemoved()) {
tp.focusedProperty().removeListener(paneFocusListener);
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/javafx.graphics/src/main/java/javafx/css/Rule.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, 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
Expand Down Expand Up @@ -266,7 +266,7 @@ private Observables(Rule rule) {
}

if (c.wasRemoved()) {
List<Selector> removed = c.getAddedSubList();
List<Selector> removed = c.getRemoved();
for(int i = 0, max = removed.size(); i < max; i++) {
Selector sel = removed.get(i);
if (sel.getRule() == Observables.this.rule) {
Expand Down

0 comments on commit 55eb83d

Please sign in to comment.