jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthContext.java
changeset 37698 4d798c873df0
parent 25859 3317bb8137f4
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthContext.java	Fri Apr 15 15:50:45 2016 +0530
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthContext.java	Fri Apr 15 19:15:12 2016 +0400
@@ -24,8 +24,6 @@
  */
 package javax.swing.plaf.synth;
 
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
 import javax.swing.JComponent;
 
 /**
@@ -40,7 +38,6 @@
  * @author Scott Violet
  */
 public class SynthContext {
-    private static final Queue<SynthContext> queue = new ConcurrentLinkedQueue<>();
 
     private JComponent component;
     private Region region;
@@ -54,19 +51,15 @@
     static SynthContext getContext(JComponent component,
                                    Region region, SynthStyle style,
                                    int state) {
-        SynthContext context = queue.poll();
-        if (context == null) {
-            context = new SynthContext();
-        }
-        context.reset(component, region, style, state);
+        SynthContext context = new SynthContext();
+        context.component = component;
+        context.region = region;
+        context.style = style;
+        context.state = state;
         return context;
     }
 
-    static void releaseContext(SynthContext context) {
-        queue.offer(context);
-    }
-
-    SynthContext() {
+    private SynthContext() {
     }
 
     /**
@@ -86,7 +79,11 @@
             throw new NullPointerException(
                 "You must supply a non-null component, region and style");
         }
-        reset(component, region, style, state);
+
+        this.component = component;
+        this.region = region;
+        this.style = style;
+        this.state = state;
     }
 
 
@@ -147,23 +144,6 @@
     }
 
     /**
-     * Resets the state of the Context.
-     */
-    void reset(JComponent component, Region region, SynthStyle style,
-               int state) {
-        this.component = component;
-        this.region = region;
-        this.style = style;
-        this.state = state;
-    }
-
-    void dispose() {
-        this.component = null;
-        this.style = null;
-        releaseContext(this);
-    }
-
-    /**
      * Convenience method to get the Painter from the current SynthStyle.
      * This will NEVER return null.
      */