[utilities COMMIT] /java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/xml/BasicParserPool.java

noreply at shibboleth.net noreply at shibboleth.net
Sun Jul 13 13:37:27 EDT 2014


Author: rdw
Date: Sun Jul 13 13:37:27 2014
New Revision: 626

URL: http://svn.shibboleth.net/view/utilities?rev=626&view=rev
Log:
IDP-408 Remove syncrhonized methods since we us initialization to control setter access

Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/xml/BasicParserPool.java

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/xml/BasicParserPool.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/xml/BasicParserPool.java?rev=626&r1=625&r2=626&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/xml/BasicParserPool.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/xml/BasicParserPool.java Sun Jul 13 13:37:27 2014
@@ -85,7 +85,7 @@
     private DocumentBuilderFactory builderFactory;
 
     /** Cache of document builders. */
-    private Stack<SoftReference<DocumentBuilder>> builderPool;
+    private final Stack<SoftReference<DocumentBuilder>> builderPool;
 
     /** Max number of builders allowed in the pool. Default value: 5 */
     private int maxPoolSize;
@@ -124,7 +124,7 @@
     private EntityResolver entityResolver;
 
     /** Error handler used by builders. */
-    private ErrorHandler errorHandler;
+    private final ErrorHandler errorHandler;
 
     /** Constructor. */
     public BasicParserPool() {
@@ -279,7 +279,7 @@
      * 
      * @param newSize max number of builders the pool will hold
      */
-    public synchronized void setMaxPoolSize(final int newSize) {
+    public void setMaxPoolSize(final int newSize) {
         checkNotInitializedNotDestroyed();
 
         maxPoolSize = (int) Constraint.isGreaterThan(0, newSize, "New maximum pool size must be greater than 0");
@@ -299,7 +299,7 @@
      * 
      * @param newAttributes builder attributes used when creating builders
      */
-    public synchronized void setBuilderAttributes(@Nullable @NullableElements final Map<String, Object> newAttributes) {
+    public void setBuilderAttributes(@Nullable @NullableElements final Map<String, Object> newAttributes) {
         checkNotInitializedNotDestroyed();
 
         if (newAttributes == null) {
@@ -323,7 +323,7 @@
      * 
      * @param isCoalescing whether the builders are coalescing
      */
-    public synchronized void setCoalescing(final boolean isCoalescing) {
+    public void setCoalescing(final boolean isCoalescing) {
         checkNotInitializedNotDestroyed();
 
         coalescing = isCoalescing;
@@ -343,7 +343,7 @@
      * 
      * @param expand whether builders expand entity references
      */
-    public synchronized void setExpandEntityReferences(final boolean expand) {
+    public void setExpandEntityReferences(final boolean expand) {
         checkNotInitializedNotDestroyed();
 
         expandEntityReferences = expand;
@@ -363,7 +363,7 @@
      * 
      * @param newFeatures the builders' features
      */
-    public synchronized void setBuilderFeatures(@Nullable @NullableElements final Map<String, Boolean> newFeatures) {
+    public void setBuilderFeatures(@Nullable @NullableElements final Map<String, Boolean> newFeatures) {
         checkNotInitializedNotDestroyed();
 
         if (newFeatures == null) {
@@ -387,7 +387,7 @@
      * 
      * @param ignore The ignoreComments to set.
      */
-    public synchronized void setIgnoreComments(final boolean ignore) {
+    public void setIgnoreComments(final boolean ignore) {
         checkNotInitializedNotDestroyed();
 
         ignoreComments = ignore;
@@ -407,7 +407,7 @@
      * 
      * @param ignore whether the builders ignore element content whitespace
      */
-    public synchronized void setIgnoreElementContentWhitespace(final boolean ignore) {
+    public void setIgnoreElementContentWhitespace(final boolean ignore) {
         checkNotInitializedNotDestroyed();
 
         ignoreElementContentWhitespace = ignore;
@@ -427,7 +427,7 @@
      * 
      * @param isNamespaceAware whether the builders are namespace aware
      */
-    public synchronized void setNamespaceAware(final boolean isNamespaceAware) {
+    public void setNamespaceAware(final boolean isNamespaceAware) {
         checkNotInitializedNotDestroyed();
 
         namespaceAware = isNamespaceAware;
@@ -447,7 +447,7 @@
      * 
      * @param newSchema schema used to validate the XML document during the parsing process
      */
-    public synchronized void setSchema(@Nullable final Schema newSchema) {
+    public void setSchema(@Nullable final Schema newSchema) {
         checkNotInitializedNotDestroyed();
 
         schema = newSchema;
@@ -472,7 +472,7 @@
      * 
      * @param isValidating whether the builders are validating
      */
-    public synchronized void setDTDValidating(final boolean isValidating) {
+    public void setDTDValidating(final boolean isValidating) {
         checkNotInitializedNotDestroyed();
 
         dtdValidating = isValidating;
@@ -492,7 +492,7 @@
      * 

[... 24 lines stripped ...]


More information about the commits mailing list