From 2b7185f10f09c92c7be340768514fbaf41d30960 Mon Sep 17 00:00:00 2001 From: norman Date: Wed, 18 Jul 2012 09:17:15 +0200 Subject: [PATCH] Remove unused buggy code --- .../netty/util/internal/QueueFactory.java | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/src/main/java/org/jboss/netty/util/internal/QueueFactory.java b/src/main/java/org/jboss/netty/util/internal/QueueFactory.java index 6dfe83a39e..28594d6a37 100644 --- a/src/main/java/org/jboss/netty/util/internal/QueueFactory.java +++ b/src/main/java/org/jboss/netty/util/internal/QueueFactory.java @@ -15,7 +15,6 @@ */ package org.jboss.netty.util.internal; -import java.util.Collection; import java.util.concurrent.BlockingQueue; import org.jboss.netty.logging.InternalLogger; @@ -66,37 +65,4 @@ public final class QueueFactory { return new LegacyLinkedTransferQueue(); } - - /** - * Create a new unbound {@link BlockingQueue} - * - * @param collection the collection which should get copied to the newly created {@link BlockingQueue} - * @param itemClass the {@link Class} type which will be used as {@link BlockingQueue} items - * @return queue the {@link BlockingQueue} implementation - */ - public static BlockingQueue createQueue(Collection collection, Class itemClass) { - // if we run in java >=7 its the best to just use the LinkedTransferQueue which - // comes with java bundled. See #273 - if (DetectionUtil.javaVersion() >= 7) { - return new java.util.concurrent.LinkedTransferQueue(); - } - - try { - if (useUnsafe) { - return new LinkedTransferQueue(collection); - } - } catch (Throwable t) { - // For whatever reason an exception was thrown while loading the LinkedTransferQueue - // - // This mostly happens because of a custom classloader or security policy that did not - // allow us to access the com.sun.Unmisc class. So just log it and fallback to the old - // LegacyLinkedTransferQueue that works in all cases - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Unable to instance LinkedTransferQueue, fallback to LegacyLinkedTransferQueue", t); - } - } - - return new LegacyLinkedTransferQueue(collection); - - } }