mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-35287 - NPE: DocumentImpl.changedUpdate
This commit is contained in:
@@ -41,6 +41,7 @@ public interface PrioritizedDocumentListener extends DocumentListener {
|
||||
}
|
||||
|
||||
private int getPriority(Object o) {
|
||||
assert o != null;
|
||||
if (o instanceof PrioritizedDocumentListener) return ((PrioritizedDocumentListener)o).getPriority();
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@@ -679,7 +679,8 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
|
||||
private DocumentListener[] getCachedListeners() {
|
||||
DocumentListener[] cachedListeners = myCachedDocumentListeners;
|
||||
if (cachedListeners == null) {
|
||||
DocumentListener[] listeners = myDocumentListeners.toArray(new DocumentListener[myDocumentListeners.size()]);
|
||||
List<DocumentListener> copy = new ArrayList<DocumentListener>(myDocumentListeners);
|
||||
DocumentListener[] listeners = copy.toArray(new DocumentListener[copy.size()]);
|
||||
Arrays.sort(listeners, PrioritizedDocumentListener.COMPARATOR);
|
||||
myCachedDocumentListeners = cachedListeners = listeners;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user