aboutsummaryrefslogtreecommitdiff
path: root/src/com/sun/org/apache/xerces/internal/dom/LCount.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/sun/org/apache/xerces/internal/dom/LCount.java')
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/LCount.java27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/com/sun/org/apache/xerces/internal/dom/LCount.java b/src/com/sun/org/apache/xerces/internal/dom/LCount.java
index 91ec8d5..77545bd 100644
--- a/src/com/sun/org/apache/xerces/internal/dom/LCount.java
+++ b/src/com/sun/org/apache/xerces/internal/dom/LCount.java
@@ -1,13 +1,13 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -22,20 +22,13 @@ package com.sun.org.apache.xerces.internal.dom;
/** Internal class LCount is used to track the number of
listeners registered for a given event name, as an entry
- in a global hashtable. This should allow us to avoid generating,
- or discard, events for which no listeners are registered.
+ in a global Map. This should allow us to avoid generating,
+ or discarding, events for which no listeners are registered.
***** There should undoubtedly be methods here to manipulate
this table. At the moment that code's residing in NodeImpl.
Move it when we have a chance to do so. Sorry; we were
rushed.
-
- ???? CONCERN: Hashtables are known to be "overserialized" in
- current versions of Java. That may impact performance.
-
- ???? CONCERN: The hashtable should probably be a per-document object.
- Finer granularity would be even better, but would cost more cycles to
- resolve and might not save enough event traffic to be worth the investment.
*/
/**
* @xerces.internal
@@ -44,7 +37,7 @@ package com.sun.org.apache.xerces.internal.dom;
class LCount
{
- static java.util.Hashtable lCounts=new java.util.Hashtable();
+ static final java.util.Map<String, LCount> lCounts=new java.util.concurrent.ConcurrentHashMap<>();
public int captures=0,bubbles=0,defaults, total=0;
static LCount lookup(String evtName)