diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2012-01-27 11:33:42 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2012-01-27 11:33:42 +0000 |
commit | f8a69b681aa852848c0b720481f45de8ca934f78 (patch) | |
tree | bc3d0d5145b4be33aa8bfcee34e1c1b0b11caf28 /qpid/java/common | |
parent | 7210d9f8aaecf65d0469787c5b99192606ef3a8a (diff) | |
download | qpid-python-f8a69b681aa852848c0b720481f45de8ca934f78.tar.gz |
NO-JIRA : [Java] Tidy up import statements across the codebase, remove unused/redundant imports (keep Checkstyle happy)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1236638 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common')
125 files changed, 411 insertions, 423 deletions
diff --git a/qpid/java/common/Composite.tpl b/qpid/java/common/Composite.tpl index 2cbd6830f6..c3e4765c9c 100644 --- a/qpid/java/common/Composite.tpl +++ b/qpid/java/common/Composite.tpl @@ -21,22 +21,12 @@ package org.apache.qpid.transport; */ -import java.nio.ByteBuffer; -import java.util.ArrayList; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; -import java.util.UUID; import org.apache.qpid.transport.codec.Decoder; -import org.apache.qpid.transport.codec.Encodable; import org.apache.qpid.transport.codec.Encoder; -import org.apache.qpid.transport.network.Frame; - -import org.apache.qpid.util.Strings; - - ${ from genutil import * @@ -77,6 +67,13 @@ PACK_TYPES = { } typecode = code(type) + +if segments: + out("import java.nio.ByteBuffer;\n") + out("import org.apache.qpid.util.Strings;\n") + +if track != "-1": + out("import org.apache.qpid.transport.network.Frame;\n") } public final class $name extends $base { diff --git a/qpid/java/common/Invoker.tpl b/qpid/java/common/Invoker.tpl index 2eed43ad28..2087710517 100644 --- a/qpid/java/common/Invoker.tpl +++ b/qpid/java/common/Invoker.tpl @@ -21,10 +21,7 @@ package org.apache.qpid.transport; */ -import java.nio.ByteBuffer; -import java.util.List; import java.util.Map; -import java.util.UUID; public abstract class $(invoker) { ${ diff --git a/qpid/java/common/genutil.py b/qpid/java/common/genutil.py index 57a461ed40..7996cca450 100644 --- a/qpid/java/common/genutil.py +++ b/qpid/java/common/genutil.py @@ -109,7 +109,7 @@ TYPES = { "uint32": "long", "uint64": "long", "datetime": "long", - "uuid": "UUID", + "uuid": "java.util.UUID", "sequence-no": "int", "sequence-set": "RangeSet", # XXX "byte-ranges": "RangeSet", # XXX @@ -120,7 +120,7 @@ TYPES = { "vbin32": "byte[]", "struct32": "Struct", "map": "Map<String,Object>", - "array": "List<Object>" + "array": "java.util.List<Object>" } def cname(nd, field="@name"): @@ -232,7 +232,7 @@ def get_parameters(type, fields): params.append("%s %s" % (f.type, f.name)) if type["segments"]: params.append("Header header") - params.append("ByteBuffer body") + params.append("java.nio.ByteBuffer body") if options or type.name in ("control", "command"): params.append("Option ... _options") return params diff --git a/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java b/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java index 2f6290b55a..44cd603a8d 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java @@ -20,7 +20,9 @@ */ package org.apache.qpid; -import org.apache.qpid.framing.*; +import org.apache.qpid.framing.AMQFrame; +import org.apache.qpid.framing.MethodRegistry; +import org.apache.qpid.framing.ProtocolVersion; import org.apache.qpid.protocol.AMQConstant; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java b/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java index ca9c9f9dc4..92eca6bfbe 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java @@ -21,7 +21,9 @@ package org.apache.qpid; -import org.apache.qpid.framing.*; +import org.apache.qpid.framing.AMQFrame; +import org.apache.qpid.framing.MethodRegistry; +import org.apache.qpid.framing.ProtocolVersion; import org.apache.qpid.protocol.AMQConstant; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java b/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java index f2503e549f..3b1b04220f 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java @@ -20,10 +20,10 @@ */ package org.apache.qpid; -import java.util.Collection; - import org.apache.qpid.protocol.AMQConstant; +import java.util.Collection; + /** * AMQConnectionFailureException indicates that a connection to a broker could not be formed. * diff --git a/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java b/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java index 00ad5cf08a..51ceceb6e7 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java @@ -20,12 +20,12 @@ */ package org.apache.qpid; +import org.apache.qpid.transport.Sender; + import static org.apache.qpid.transport.util.Functions.str; import java.nio.ByteBuffer; -import org.apache.qpid.transport.Sender; - /** * ConsoleOutput diff --git a/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java b/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java index df6f279026..49c7be162c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java @@ -1,11 +1,11 @@ package org.apache.qpid.api; -import java.io.IOException; -import java.nio.ByteBuffer; - -import org.apache.qpid.transport.MessageProperties; import org.apache.qpid.transport.DeliveryProperties; import org.apache.qpid.transport.Header; +import org.apache.qpid.transport.MessageProperties; + +import java.io.IOException; +import java.nio.ByteBuffer; /* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java b/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java index 1d196534b2..ffdb7e6573 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java @@ -20,13 +20,27 @@ */ package org.apache.qpid.codec; -import java.io.*; -import java.nio.ByteBuffer; -import java.util.*; - -import org.apache.qpid.framing.*; +import org.apache.qpid.framing.AMQDataBlock; +import org.apache.qpid.framing.AMQDataBlockDecoder; +import org.apache.qpid.framing.AMQFrameDecodingException; +import org.apache.qpid.framing.AMQMethodBodyFactory; +import org.apache.qpid.framing.AMQProtocolVersionException; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.framing.ByteArrayDataInput; +import org.apache.qpid.framing.EncodingUtils; +import org.apache.qpid.framing.ProtocolInitiation; import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; +import java.io.ByteArrayInputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.ListIterator; + /** * AMQDecoder delegates the decoding of AMQP either to a data block decoder, or in the case of new connections, to a * protocol initiation decoder. It is a cumulative decoder, which means that it can accumulate data to decode in the diff --git a/qpid/java/common/src/main/java/org/apache/qpid/configuration/Accessor.java b/qpid/java/common/src/main/java/org/apache/qpid/configuration/Accessor.java index dc5b69dc89..134bd9da72 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/configuration/Accessor.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/configuration/Accessor.java @@ -24,7 +24,6 @@ package org.apache.qpid.configuration; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java b/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java index 73a336321c..b8181e3b87 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java @@ -21,7 +21,6 @@ package org.apache.qpid.configuration; import org.apache.qpid.AMQException; -import org.apache.qpid.protocol.AMQConstant; /** * Indicates a failure to parse a property expansion. See {@link PropertyUtils} for the code that does property diff --git a/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java index 69457ca4a9..3590254d27 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java @@ -19,11 +19,13 @@ package org.apache.qpid.dtx; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.apache.qpid.AMQInvalidArgumentException; import javax.transaction.xa.Xid; - -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; import java.util.Arrays; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java index 363d9f1ccc..cb0c78ef37 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java @@ -20,13 +20,12 @@ */ package org.apache.qpid.framing; +import org.apache.qpid.AMQException; +import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; + import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.IOException; -import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; -import org.apache.qpid.AMQException; - public interface AMQBody { public byte getFrameType(); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java index e77e5942e3..fd42084429 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java @@ -20,9 +20,7 @@ */ package org.apache.qpid.framing; -import java.io.DataInputStream; import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.IOException; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java index b6f2fb18ea..9867bbf4e2 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.framing; -import org.apache.qpid.codec.MarkableDataInput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.DataInputStream; +import org.apache.qpid.codec.MarkableDataInput; + import java.io.IOException; public class AMQDataBlockDecoder diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java index 9b5699e8ff..238f28e73e 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java @@ -22,8 +22,8 @@ package org.apache.qpid.framing; import org.apache.qpid.codec.MarkableDataInput; -import java.io.*; import java.io.DataOutput; +import java.io.IOException; public class AMQFrame extends AMQDataBlock implements EncodableAMQDataBlock { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java index 2170ebf992..f5fbbac42b 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java @@ -26,7 +26,6 @@ import org.apache.qpid.AMQException; import org.apache.qpid.protocol.AMQConstant; import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.IOException; public interface AMQMethodBody extends AMQBody diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java index ec6d662726..7fe293b6b7 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java @@ -20,14 +20,12 @@ */ package org.apache.qpid.framing; -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.DataInput; -import java.io.DataInputStream; +import org.apache.qpid.codec.MarkableDataInput; +import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; + import java.io.IOException; public class AMQMethodBodyFactory implements BodyFactory diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java index 4ff7827d7f..3951f17681 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java @@ -25,11 +25,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.DataInput; -import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; -import java.util.*; import java.lang.ref.WeakReference; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.WeakHashMap; /** * A short string is a representation of an AMQ Short String diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java index f64164c10b..c4dc86bf11 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java @@ -20,10 +20,12 @@ */ package org.apache.qpid.framing; -import java.io.*; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.math.BigDecimal; import java.util.Date; import java.util.Map; -import java.math.BigDecimal; /** * AMQTypedValue combines together a native Java Object value, and an {@link AMQType}, as a fully typed AMQP parameter diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java index 2739f7d14b..f942d33389 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java @@ -20,14 +20,13 @@ */ package org.apache.qpid.framing; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.DataInput; -import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class BasicContentHeaderProperties implements CommonContentHeaderProperties { //persistent & non-persistent constants, values as per JMS DeliveryMode diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java index 656185629b..196ab422a3 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java @@ -2,8 +2,6 @@ package org.apache.qpid.framing; import org.apache.qpid.codec.MarkableDataInput; -import java.io.IOException; - public class ByteArrayDataInput implements ExtendedDataInput, MarkableDataInput { private byte[] _data; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java index 541d104dc9..26b3bcc34c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java @@ -20,15 +20,15 @@ */ package org.apache.qpid.framing; +import org.apache.qpid.AMQException; +import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; + import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; import java.nio.ByteBuffer; -import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; -import org.apache.qpid.AMQException; - public class ContentBody implements AMQBody { public static final byte TYPE = 3; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java index de2ffe9755..10df105ee6 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java @@ -20,12 +20,13 @@ */ package org.apache.qpid.framing; -import java.io.IOException; - -import org.apache.qpid.codec.MarkableDataInput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.qpid.codec.MarkableDataInput; + +import java.io.IOException; + public class ContentBodyFactory implements BodyFactory { private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java index 8a2ad53157..46f4c294b4 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java @@ -20,14 +20,14 @@ */ package org.apache.qpid.framing; +import org.apache.qpid.AMQException; +import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; + import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; -import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; -import org.apache.qpid.AMQException; - public class ContentHeaderBody implements AMQBody { public static final byte TYPE = 2; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java index c3e4c69ec0..83a5211013 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java @@ -20,12 +20,13 @@ */ package org.apache.qpid.framing; -import java.io.IOException; - -import org.apache.qpid.codec.MarkableDataInput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.qpid.codec.MarkableDataInput; + +import java.io.IOException; + public class ContentHeaderBodyFactory implements BodyFactory { private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java index ea8358a538..2e1b988aa3 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java @@ -21,7 +21,6 @@ package org.apache.qpid.framing; import java.io.DataInput; -import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java index 48bd52858d..ff97c0b28f 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java @@ -20,12 +20,11 @@ */ package org.apache.qpid.framing; +import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl; + import java.io.DataInput; -import java.io.DataInputStream; import java.io.IOException; -import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl; - public class ContentHeaderPropertiesFactory { private static final ContentHeaderPropertiesFactory _instance = new ContentHeaderPropertiesFactory(); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java index e018407509..538e0e1327 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java @@ -20,11 +20,12 @@ */ package org.apache.qpid.framing; -import java.io.*; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.Charset; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java index 863e363b87..57f2c638a2 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java @@ -25,7 +25,11 @@ import org.slf4j.LoggerFactory; import org.apache.qpid.AMQPInvalidClassException; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; import java.math.BigDecimal; import java.util.Collections; import java.util.Enumeration; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java index af0c5b845c..b2b78ebcef 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java @@ -21,7 +21,6 @@ package org.apache.qpid.framing; import java.io.DataInput; -import java.io.DataInputStream; import java.io.IOException; public class FieldTableFactory diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java index 95b6246717..1613cd055e 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.framing; +import org.apache.qpid.AMQException; +import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; + import java.io.DataInputStream; import java.io.DataOutput; import java.io.IOException; -import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; -import org.apache.qpid.AMQException; - public class HeartbeatBody implements AMQBody { public static final byte TYPE = 8; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java index 2925724dc2..f2cac92c78 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java @@ -23,8 +23,9 @@ package org.apache.qpid.framing; import org.apache.qpid.AMQException; import org.apache.qpid.codec.MarkableDataInput; -import java.io.*; - +import java.io.DataOutput; +import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.util.Arrays; public class ProtocolInitiation extends AMQDataBlock implements EncodableAMQDataBlock diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java index e770fdd7e4..a026c3201e 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java @@ -20,14 +20,13 @@ */ package org.apache.qpid.framing; -import java.io.DataInputStream; -import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.qpid.codec.MarkableDataInput; import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.io.IOException; public class VersionSpecificRegistry { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImpl.java index e3d5da73da..53c70c8d71 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImpl.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImpl.java @@ -20,7 +20,6 @@ */ package org.apache.qpid.framing.abstraction; -import org.apache.qpid.framing.abstraction.MessagePublishInfo; import org.apache.qpid.framing.AMQShortString; public class MessagePublishInfoImpl implements MessagePublishInfo diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java index 90a730d6f7..d2a639591a 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java @@ -21,12 +21,16 @@ package org.apache.qpid.framing.amqp_0_9; +import org.apache.qpid.framing.AMQBody; +import org.apache.qpid.framing.AMQMethodBody; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.framing.BasicPublishBody; +import org.apache.qpid.framing.ContentBody; import org.apache.qpid.framing.abstraction.AbstractMethodConverter; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; import org.apache.qpid.framing.abstraction.ContentChunk; import org.apache.qpid.framing.abstraction.MessagePublishInfo; import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; -import org.apache.qpid.framing.*; +import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; public class MethodConverter_0_9 extends AbstractMethodConverter implements ProtocolVersionMethodConverter diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java index 3b0cc3cebc..6067a6ca6b 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java @@ -21,12 +21,16 @@ package org.apache.qpid.framing.amqp_0_91; +import org.apache.qpid.framing.AMQBody; +import org.apache.qpid.framing.AMQMethodBody; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.framing.BasicPublishBody; +import org.apache.qpid.framing.ContentBody; import org.apache.qpid.framing.abstraction.AbstractMethodConverter; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; import org.apache.qpid.framing.abstraction.ContentChunk; import org.apache.qpid.framing.abstraction.MessagePublishInfo; import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; -import org.apache.qpid.framing.*; +import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; public class MethodConverter_0_91 extends AbstractMethodConverter implements ProtocolVersionMethodConverter { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java index e6d0482f0d..80e47bb84c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java @@ -21,12 +21,16 @@ package org.apache.qpid.framing.amqp_8_0; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; +import org.apache.qpid.framing.AMQBody; +import org.apache.qpid.framing.AMQMethodBody; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.framing.BasicPublishBody; +import org.apache.qpid.framing.ContentBody; +import org.apache.qpid.framing.abstraction.AbstractMethodConverter; import org.apache.qpid.framing.abstraction.ContentChunk; import org.apache.qpid.framing.abstraction.MessagePublishInfo; -import org.apache.qpid.framing.abstraction.AbstractMethodConverter; import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; -import org.apache.qpid.framing.*; +import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; public class MethodConverter_8_0 extends AbstractMethodConverter implements ProtocolVersionMethodConverter { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/messaging/Address.java b/qpid/java/common/src/main/java/org/apache/qpid/messaging/Address.java index d9c12148cb..bccae8e671 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/messaging/Address.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/messaging/Address.java @@ -20,12 +20,12 @@ */ package org.apache.qpid.messaging; -import java.util.Map; - import org.apache.qpid.messaging.util.AddressParser; import static org.apache.qpid.messaging.util.PyPrint.pprint; +import java.util.Map; + /** * Address diff --git a/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/AddressParser.java b/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/AddressParser.java index 9fb30f9b8a..d1e10607ac 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/AddressParser.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/AddressParser.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.messaging.util; +import org.apache.qpid.messaging.Address; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.qpid.messaging.Address; - /** * AddressParser diff --git a/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/JAddr.java b/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/JAddr.java index 93df052af1..225f7c11e9 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/JAddr.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/JAddr.java @@ -20,16 +20,13 @@ */ package org.apache.qpid.messaging.util; -import java.io.InputStreamReader; - -import java.util.List; - import org.apache.qpid.messaging.Address; -import org.apache.qpid.messaging.util.ParseError; -import org.apache.qpid.messaging.util.Token; import static org.apache.qpid.messaging.util.PyPrint.pprint; +import java.io.InputStreamReader; +import java.util.List; + /** * JAddr diff --git a/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexer.java b/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexer.java index 8226cc77cb..9638ec78e2 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexer.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexer.java @@ -21,9 +21,7 @@ package org.apache.qpid.messaging.util; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.NoSuchElementException; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java b/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java index 3e99b244c4..0df9a85676 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java @@ -22,10 +22,10 @@ package org.apache.qpid.pool; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import java.util.concurrent.LinkedBlockingQueue; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java b/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java index 14d1befaf1..2a2342ca14 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.protocol; +import org.apache.qpid.framing.AMQShortString; + import java.util.HashMap; import java.util.Map; -import org.apache.qpid.framing.AMQShortString; - /** * Defines constants for AMQP codes and also acts as a factory for creating such constants from the raw codes. Each * constant also defines a short human readable description of the constant. diff --git a/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java b/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java index 5a7679a972..8cc9709c9c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java @@ -20,8 +20,8 @@ */ package org.apache.qpid.protocol; -import org.apache.qpid.framing.AMQMethodBody; import org.apache.qpid.AMQException; +import org.apache.qpid.framing.AMQMethodBody; /** * AMQMethodListener is a listener that receives notifications of AMQP methods. The methods are packaged as events in diff --git a/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java b/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java index b58e7d01dc..260c17f193 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java @@ -20,9 +20,13 @@ */ package org.apache.qpid.protocol; -import org.apache.qpid.framing.*; -import org.apache.qpid.transport.Sender; import org.apache.qpid.AMQException; +import org.apache.qpid.framing.AMQMethodBody; +import org.apache.qpid.framing.ContentBody; +import org.apache.qpid.framing.ContentHeaderBody; +import org.apache.qpid.framing.HeartbeatBody; +import org.apache.qpid.framing.MethodRegistry; +import org.apache.qpid.transport.Sender; import java.nio.ByteBuffer; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngine.java b/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngine.java index fd651a2b66..7ca588946b 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngine.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngine.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.protocol; -import java.net.SocketAddress; -import java.nio.ByteBuffer; - import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.Sender; import org.apache.qpid.transport.network.NetworkConnection; +import java.net.SocketAddress; +import java.nio.ByteBuffer; + /** * A ProtocolEngine is a Receiver for java.nio.ByteBuffers. It takes the data passed to it in the received * decodes it and then process the result. diff --git a/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngineFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngineFactory.java index 7378edff0c..885a6a975d 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngineFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolEngineFactory.java @@ -20,9 +20,7 @@ */ package org.apache.qpid.protocol; -import org.apache.qpid.transport.network.NetworkConnection; - -public interface ProtocolEngineFactory +public interface ProtocolEngineFactory { // Returns a new instance of a ProtocolEngine diff --git a/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java index 01f13408b0..87073c1090 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java @@ -20,18 +20,17 @@ */ package org.apache.qpid.ssl; -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.KeyStore; +import org.apache.qpid.transport.network.security.ssl.QpidClientX509KeyManager; +import org.apache.qpid.transport.network.security.ssl.SSLUtil; import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; - -import org.apache.qpid.transport.network.security.ssl.QpidClientX509KeyManager; -import org.apache.qpid.transport.network.security.ssl.SSLUtil; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.security.KeyStore; /** * Factory used to create SSLContexts. SSL needs to be configured diff --git a/qpid/java/common/src/main/java/org/apache/qpid/thread/LoggingUncaughtExceptionHandler.java b/qpid/java/common/src/main/java/org/apache/qpid/thread/LoggingUncaughtExceptionHandler.java index 192675edcd..58d80454b7 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/thread/LoggingUncaughtExceptionHandler.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/thread/LoggingUncaughtExceptionHandler.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.thread; -import java.lang.Thread.UncaughtExceptionHandler; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.Thread.UncaughtExceptionHandler; + /** * * An {@link UncaughtExceptionHandler} that writes the exception to the application log via diff --git a/qpid/java/common/src/main/java/org/apache/qpid/thread/QpidThreadExecutor.java b/qpid/java/common/src/main/java/org/apache/qpid/thread/QpidThreadExecutor.java index 30010a2d89..06f5e6b835 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/thread/QpidThreadExecutor.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/thread/QpidThreadExecutor.java @@ -21,8 +21,6 @@ package org.apache.qpid.thread; -import org.apache.qpid.thread.Threading; - import java.util.concurrent.Executor; public class QpidThreadExecutor implements Executor diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java index 491a7ac218..e3e6f81f7c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java @@ -20,9 +20,9 @@ */ package org.apache.qpid.transport; -import java.nio.ByteBuffer; +import static org.apache.qpid.transport.util.Functions.str; -import static org.apache.qpid.transport.util.Functions.*; +import java.nio.ByteBuffer; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java index 9bdad6b00e..9bf37f07ec 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java @@ -20,20 +20,19 @@ */ package org.apache.qpid.transport; +import org.apache.qpid.transport.util.Logger; + import static org.apache.qpid.transport.Connection.State.OPEN; import static org.apache.qpid.transport.Connection.State.RESUMING; +import javax.security.sasl.SaslClient; +import javax.security.sasl.SaslException; import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.security.sasl.SaslClient; -import javax.security.sasl.SaslException; - -import org.apache.qpid.transport.util.Logger; - /** * ClientDelegate diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java index dee5f696b9..675c3e35b5 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java @@ -20,12 +20,27 @@ */ package org.apache.qpid.transport; +import org.apache.qpid.framing.ProtocolVersion; +import org.apache.qpid.transport.network.Assembler; +import org.apache.qpid.transport.network.Disassembler; +import org.apache.qpid.transport.network.InputHandler; +import org.apache.qpid.transport.network.NetworkConnection; +import org.apache.qpid.transport.network.OutgoingNetworkTransport; +import org.apache.qpid.transport.network.Transport; +import org.apache.qpid.transport.network.security.SecurityLayer; +import org.apache.qpid.transport.network.security.SecurityLayerFactory; +import org.apache.qpid.transport.util.Logger; +import org.apache.qpid.transport.util.Waiter; +import org.apache.qpid.util.Strings; + import static org.apache.qpid.transport.Connection.State.CLOSED; import static org.apache.qpid.transport.Connection.State.CLOSING; import static org.apache.qpid.transport.Connection.State.NEW; import static org.apache.qpid.transport.Connection.State.OPEN; import static org.apache.qpid.transport.Connection.State.OPENING; +import javax.security.sasl.SaslClient; +import javax.security.sasl.SaslServer; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collection; @@ -36,22 +51,6 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -import javax.security.sasl.SaslClient; -import javax.security.sasl.SaslServer; - -import org.apache.qpid.framing.ProtocolVersion; -import org.apache.qpid.transport.network.Assembler; -import org.apache.qpid.transport.network.Disassembler; -import org.apache.qpid.transport.network.InputHandler; -import org.apache.qpid.transport.network.NetworkConnection; -import org.apache.qpid.transport.network.OutgoingNetworkTransport; -import org.apache.qpid.transport.network.Transport; -import org.apache.qpid.transport.network.security.SecurityLayer; -import org.apache.qpid.transport.network.security.SecurityLayerFactory; -import org.apache.qpid.transport.util.Logger; -import org.apache.qpid.transport.util.Waiter; -import org.apache.qpid.util.Strings; - /** * Connection diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java index 393301659d..c70cab85c9 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java @@ -22,7 +22,7 @@ package org.apache.qpid.transport; import org.apache.qpid.transport.util.Logger; -import static org.apache.qpid.transport.Connection.State.*; +import static org.apache.qpid.transport.Connection.State.CLOSE_RCVD; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java index 2ee507e2ec..f2216184aa 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java @@ -20,10 +20,10 @@ */ package org.apache.qpid.transport; -import java.util.Map; - import org.apache.qpid.configuration.ClientProperties; +import java.util.Map; + /** * A ConnectionSettings object can only be associated with * one Connection object. I have added an assertion that will diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java index 543856ca39..7ac75f9163 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java @@ -20,7 +20,7 @@ */ package org.apache.qpid.transport; -import java.util.*; +import java.util.List; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java index 3c80180d0b..cddcd45d6f 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java @@ -22,9 +22,9 @@ package org.apache.qpid.transport; import org.apache.qpid.transport.network.Frame; -import java.nio.ByteBuffer; +import static org.apache.qpid.transport.util.Functions.str; -import static org.apache.qpid.transport.util.Functions.*; +import java.nio.ByteBuffer; /** * Method diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java index e5b93e40a9..3959dc8d95 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.transport; -import java.nio.ByteBuffer; - +import org.apache.qpid.transport.network.Frame; import org.apache.qpid.transport.network.NetworkDelegate; import org.apache.qpid.transport.network.NetworkEvent; -import org.apache.qpid.transport.network.Frame; + +import java.nio.ByteBuffer; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java index c47171dc4b..8380744024 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java @@ -20,13 +20,16 @@ */ package org.apache.qpid.transport; +import static org.apache.qpid.util.Serial.gt; +import static org.apache.qpid.util.Serial.le; +import static org.apache.qpid.util.Serial.max; +import static org.apache.qpid.util.Serial.min; + import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; -import static org.apache.qpid.util.Serial.*; - /** * Range diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java index 34ebd02777..8737df88d6 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java @@ -20,9 +20,7 @@ */ package org.apache.qpid.transport; -import java.util.*; - -import static org.apache.qpid.util.Serial.*; +import java.util.Iterator; /** * RangeSet diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSetImpl.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSetImpl.java index f2540afb40..3e24c10a06 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSetImpl.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSetImpl.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.transport; +import static org.apache.qpid.util.Serial.lt; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.ListIterator; -import static org.apache.qpid.util.Serial.lt; - public class RangeSetImpl implements RangeSet { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java index 07d21c9904..6cd9da3d9a 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java @@ -20,18 +20,17 @@ */ package org.apache.qpid.transport; -import static org.apache.qpid.transport.Connection.State.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import static org.apache.qpid.transport.Connection.State.OPEN; import javax.security.sasl.Sasl; import javax.security.sasl.SaslException; import javax.security.sasl.SaslServer; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.Collections; +import java.util.List; +import java.util.Map; /** * ServerDelegate diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java index 3fc596d0eb..6784bc2279 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java @@ -21,6 +21,11 @@ package org.apache.qpid.transport; +import org.apache.qpid.configuration.ClientProperties; +import org.apache.qpid.transport.network.Frame; +import org.apache.qpid.transport.util.Logger; +import org.apache.qpid.transport.util.Waiter; + import static org.apache.qpid.transport.Option.COMPLETED; import static org.apache.qpid.transport.Option.SYNC; import static org.apache.qpid.transport.Option.TIMELY_REPLY; @@ -30,11 +35,6 @@ import static org.apache.qpid.transport.Session.State.DETACHED; import static org.apache.qpid.transport.Session.State.NEW; import static org.apache.qpid.transport.Session.State.OPEN; import static org.apache.qpid.transport.Session.State.RESUMING; - -import org.apache.qpid.configuration.ClientProperties; -import org.apache.qpid.transport.network.Frame; -import org.apache.qpid.transport.util.Logger; -import org.apache.qpid.transport.util.Waiter; import static org.apache.qpid.util.Serial.ge; import static org.apache.qpid.util.Serial.gt; import static org.apache.qpid.util.Serial.le; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java index 64f9039484..01fe05c851 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java @@ -20,9 +20,6 @@ */ package org.apache.qpid.transport; -import java.util.Collections; - - /** * SessionClosedException * diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java index c4fc9558a1..6095b892f8 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java @@ -20,8 +20,6 @@ */ package org.apache.qpid.transport; -import java.util.List; - /** * SessionException * diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java index 22bd9f34ad..d3ff33ee3b 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java @@ -20,13 +20,12 @@ */ package org.apache.qpid.transport; -import java.util.List; -import java.util.Map; - import org.apache.qpid.transport.codec.Decoder; import org.apache.qpid.transport.codec.Encodable; import org.apache.qpid.transport.codec.Encoder; +import java.util.Map; + /** * Struct diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java index 6ff3b21400..8ac8093645 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java @@ -20,8 +20,14 @@ */ package org.apache.qpid.transport.codec; -import java.io.UnsupportedEncodingException; +import org.apache.qpid.transport.Binary; +import org.apache.qpid.transport.Range; +import org.apache.qpid.transport.RangeSet; +import org.apache.qpid.transport.RangeSetFactory; +import org.apache.qpid.transport.Struct; +import org.apache.qpid.transport.Type; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; @@ -29,8 +35,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.qpid.transport.*; - /** * AbstractDecoder diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java index 0ccfcfcb70..5e0207c979 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java @@ -20,24 +20,21 @@ */ package org.apache.qpid.transport.codec; -import java.io.UnsupportedEncodingException; +import org.apache.qpid.transport.Range; +import org.apache.qpid.transport.RangeSet; +import org.apache.qpid.transport.Struct; +import org.apache.qpid.transport.Type; -import java.nio.ByteBuffer; +import static org.apache.qpid.transport.util.Functions.lsb; -import java.util.Collections; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.qpid.transport.Range; -import org.apache.qpid.transport.RangeSet; -import org.apache.qpid.transport.Struct; -import org.apache.qpid.transport.Type; - -import static org.apache.qpid.transport.util.Functions.*; - /** * AbstractEncoder diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java index 10f67e1cd6..a8ac44200f 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.transport.codec; +import org.apache.qpid.transport.Binary; + import java.nio.ByteBuffer; import java.nio.ByteOrder; -import org.apache.qpid.transport.Binary; - /** * Byte Buffer Decoder. * Decoder concrete implementor using a backing byte buffer for decoding data. diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java index a4df5b5fcb..fb3f91a3ce 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.transport.codec; +import org.apache.qpid.transport.RangeSet; +import org.apache.qpid.transport.Struct; + import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.qpid.transport.RangeSet; -import org.apache.qpid.transport.Struct; - /** * Decoder interface. diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java index 7d4f02af31..5a3cec5616 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.transport.codec; +import org.apache.qpid.transport.RangeSet; +import org.apache.qpid.transport.Struct; + import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.qpid.transport.RangeSet; -import org.apache.qpid.transport.Struct; - /** * Encoder interface. diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java index 8cd5c29f6d..b80d5dfd30 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java @@ -20,15 +20,23 @@ */ package org.apache.qpid.transport.network; +import org.apache.qpid.transport.DeliveryProperties; +import org.apache.qpid.transport.Header; +import org.apache.qpid.transport.MessageProperties; +import org.apache.qpid.transport.Method; +import org.apache.qpid.transport.ProtocolError; +import org.apache.qpid.transport.ProtocolEvent; +import org.apache.qpid.transport.ProtocolHeader; +import org.apache.qpid.transport.Receiver; +import org.apache.qpid.transport.Struct; +import org.apache.qpid.transport.codec.BBDecoder; + import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.qpid.transport.*; -import org.apache.qpid.transport.codec.BBDecoder; - /** * Assembler * diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java index 1a8d277bba..5a5de597c2 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java @@ -20,8 +20,6 @@ */ package org.apache.qpid.transport.network; -import java.nio.ByteBuffer; - import org.apache.qpid.transport.Binding; import org.apache.qpid.transport.Connection; import org.apache.qpid.transport.ConnectionDelegate; @@ -31,6 +29,8 @@ import org.apache.qpid.transport.Sender; import org.apache.qpid.transport.network.security.sasl.SASLReceiver; import org.apache.qpid.transport.network.security.sasl.SASLSender; +import java.nio.ByteBuffer; + /** * ConnectionBinding * diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java index 6ac9df9bc3..fe437ecf93 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java @@ -30,16 +30,18 @@ import org.apache.qpid.transport.SegmentType; import org.apache.qpid.transport.Sender; import org.apache.qpid.transport.Struct; import org.apache.qpid.transport.codec.BBEncoder; + import static org.apache.qpid.transport.network.Frame.FIRST_FRAME; import static org.apache.qpid.transport.network.Frame.FIRST_SEG; import static org.apache.qpid.transport.network.Frame.HEADER_SIZE; import static org.apache.qpid.transport.network.Frame.LAST_FRAME; import static org.apache.qpid.transport.network.Frame.LAST_SEG; -import static java.lang.Math.min; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import static java.lang.Math.min; + /** * Disassembler */ diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java index 849355276e..9416c4c9fa 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java @@ -21,15 +21,10 @@ package org.apache.qpid.transport.network; import org.apache.qpid.transport.SegmentType; -import org.apache.qpid.transport.util.SliceIterator; -import java.nio.ByteBuffer; - -import java.util.ArrayList; -import java.util.List; -import java.util.Iterator; +import static org.apache.qpid.transport.util.Functions.str; -import static org.apache.qpid.transport.util.Functions.*; +import java.nio.ByteBuffer; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/IncomingNetworkTransport.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/IncomingNetworkTransport.java index b371df639e..4d4274278f 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/IncomingNetworkTransport.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/IncomingNetworkTransport.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.transport.network; -import javax.net.ssl.SSLContext; - import org.apache.qpid.protocol.ProtocolEngineFactory; import org.apache.qpid.transport.NetworkTransportConfiguration; +import javax.net.ssl.SSLContext; + public interface IncomingNetworkTransport extends NetworkTransport { public void accept(NetworkTransportConfiguration config, ProtocolEngineFactory factory, SSLContext sslContext); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java index a2885f97bc..86e05db818 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java @@ -20,17 +20,19 @@ */ package org.apache.qpid.transport.network; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - import org.apache.qpid.transport.ProtocolError; import org.apache.qpid.transport.ProtocolHeader; import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.SegmentType; -import static org.apache.qpid.transport.util.Functions.*; +import static org.apache.qpid.transport.network.InputHandler.State.ERROR; +import static org.apache.qpid.transport.network.InputHandler.State.FRAME_BODY; +import static org.apache.qpid.transport.network.InputHandler.State.FRAME_HDR; +import static org.apache.qpid.transport.network.InputHandler.State.PROTO_HDR; +import static org.apache.qpid.transport.util.Functions.str; -import static org.apache.qpid.transport.network.InputHandler.State.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkConnection.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkConnection.java index 7384702525..2cc7c14f00 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkConnection.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkConnection.java @@ -20,11 +20,11 @@ */ package org.apache.qpid.transport.network; +import org.apache.qpid.transport.Sender; + import java.net.SocketAddress; import java.nio.ByteBuffer; -import org.apache.qpid.transport.Sender; - public interface NetworkConnection { Sender<ByteBuffer> getSender(); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/OutgoingNetworkTransport.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/OutgoingNetworkTransport.java index c3c248761c..854d76430b 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/OutgoingNetworkTransport.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/OutgoingNetworkTransport.java @@ -20,13 +20,12 @@ */ package org.apache.qpid.transport.network; -import java.nio.ByteBuffer; - -import javax.net.ssl.SSLContext; - import org.apache.qpid.transport.ConnectionSettings; import org.apache.qpid.transport.Receiver; +import javax.net.ssl.SSLContext; +import java.nio.ByteBuffer; + public interface OutgoingNetworkTransport extends NetworkTransport { public NetworkConnection getConnection(); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Transport.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Transport.java index da4349ba86..6a6a2b75d1 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Transport.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Transport.java @@ -20,13 +20,13 @@ */ package org.apache.qpid.transport.network; +import org.apache.qpid.framing.ProtocolVersion; +import org.apache.qpid.transport.TransportException; + import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.qpid.framing.ProtocolVersion; -import org.apache.qpid.transport.TransportException; - public class Transport { public static final String QPID_TRANSPORT_PROPNAME = "qpid.transport"; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkConnection.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkConnection.java index bfc77539ce..4046691779 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkConnection.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkConnection.java @@ -20,15 +20,16 @@ */ package org.apache.qpid.transport.network.io; -import java.net.Socket; -import java.net.SocketAddress; -import java.nio.ByteBuffer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.Sender; import org.apache.qpid.transport.network.NetworkConnection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + +import java.net.Socket; +import java.net.SocketAddress; +import java.nio.ByteBuffer; public class IoNetworkConnection implements NetworkConnection { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java index 838a662402..0de1500ad7 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java @@ -20,21 +20,27 @@ */ package org.apache.qpid.transport.network.io; -import java.io.IOException; -import java.net.*; -import java.nio.ByteBuffer; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLServerSocketFactory; - import org.apache.qpid.protocol.ProtocolEngine; import org.apache.qpid.protocol.ProtocolEngineFactory; -import org.apache.qpid.transport.*; +import org.apache.qpid.transport.ConnectionSettings; +import org.apache.qpid.transport.NetworkTransportConfiguration; +import org.apache.qpid.transport.Receiver; +import org.apache.qpid.transport.TransportException; import org.apache.qpid.transport.network.IncomingNetworkTransport; import org.apache.qpid.transport.network.NetworkConnection; import org.apache.qpid.transport.network.OutgoingNetworkTransport; import org.apache.qpid.transport.util.Logger; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocketFactory; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; +import java.nio.ByteBuffer; + public class IoNetworkTransport implements OutgoingNetworkTransport, IncomingNetworkTransport { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java index 5b714434d9..7e63071c16 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java @@ -26,6 +26,7 @@ import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.TransportException; import org.apache.qpid.transport.util.Logger; +import javax.net.ssl.SSLSocket; import java.io.IOException; import java.io.InputStream; import java.net.Socket; @@ -33,8 +34,6 @@ import java.net.SocketException; import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicBoolean; -import javax.net.ssl.SSLSocket; - /** * IoReceiver * diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java index 427487c879..a58fea47d2 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java @@ -18,6 +18,14 @@ */ package org.apache.qpid.transport.network.io; +import org.apache.qpid.common.Closeable; +import org.apache.qpid.thread.Threading; +import org.apache.qpid.transport.Sender; +import org.apache.qpid.transport.SenderClosedException; +import org.apache.qpid.transport.SenderException; +import org.apache.qpid.transport.TransportException; +import org.apache.qpid.transport.util.Logger; + import static org.apache.qpid.transport.util.Functions.mod; import java.io.IOException; @@ -28,14 +36,6 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.qpid.common.Closeable; -import org.apache.qpid.thread.Threading; -import org.apache.qpid.transport.Sender; -import org.apache.qpid.transport.SenderClosedException; -import org.apache.qpid.transport.SenderException; -import org.apache.qpid.transport.TransportException; -import org.apache.qpid.transport.util.Logger; - public final class IoSender implements Runnable, Sender<ByteBuffer> { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayer.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayer.java index 9fd65c6e51..51ef266ee9 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayer.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayer.java @@ -20,22 +20,10 @@ */ package org.apache.qpid.transport.network.security; -import java.nio.ByteBuffer; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLEngine; - -import org.apache.qpid.ssl.SSLContextFactory; -import org.apache.qpid.transport.Connection; -import org.apache.qpid.transport.ConnectionSettings; import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.Sender; -import org.apache.qpid.transport.TransportException; -import org.apache.qpid.transport.network.security.sasl.SASLReceiver; -import org.apache.qpid.transport.network.security.sasl.SASLSender; -import org.apache.qpid.transport.network.security.ssl.SSLReceiver; -import org.apache.qpid.transport.network.security.ssl.SSLSender; -import org.apache.qpid.transport.network.security.ssl.SSLUtil; + +import java.nio.ByteBuffer; public interface SecurityLayer { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayerFactory.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayerFactory.java index 08934004a8..6388762026 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayerFactory.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/SecurityLayerFactory.java @@ -21,7 +21,10 @@ package org.apache.qpid.transport.network.security; import org.apache.qpid.ssl.SSLContextFactory; -import org.apache.qpid.transport.*; +import org.apache.qpid.transport.ConnectionSettings; +import org.apache.qpid.transport.Receiver; +import org.apache.qpid.transport.Sender; +import org.apache.qpid.transport.TransportException; import org.apache.qpid.transport.network.security.sasl.SASLReceiver; import org.apache.qpid.transport.network.security.sasl.SASLSender; import org.apache.qpid.transport.network.security.ssl.SSLReceiver; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java index 7964239e31..6c615c05b6 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLEncryptor.java @@ -21,15 +21,13 @@ package org.apache.qpid.transport.network.security.sasl; */ -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.security.sasl.Sasl; -import javax.security.sasl.SaslClient; - import org.apache.qpid.transport.Connection; import org.apache.qpid.transport.ConnectionException; import org.apache.qpid.transport.ConnectionListener; +import javax.security.sasl.Sasl; +import javax.security.sasl.SaslClient; + public abstract class SASLEncryptor implements ConnectionListener { protected SaslClient saslClient; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java index 86106318ef..5e8acc22a8 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java @@ -21,15 +21,13 @@ package org.apache.qpid.transport.network.security.sasl; */ -import java.nio.ByteBuffer; - -import javax.security.sasl.SaslClient; -import javax.security.sasl.SaslException; - import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.SenderException; import org.apache.qpid.transport.util.Logger; +import javax.security.sasl.SaslException; +import java.nio.ByteBuffer; + public class SASLReceiver extends SASLEncryptor implements Receiver<ByteBuffer> { Receiver<ByteBuffer> delegate; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java index 2d9e4e9a7e..ce80f32eb8 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLSender.java @@ -21,16 +21,14 @@ package org.apache.qpid.transport.network.security.sasl; */ -import java.nio.ByteBuffer; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.security.sasl.SaslClient; -import javax.security.sasl.SaslException; - import org.apache.qpid.transport.Sender; import org.apache.qpid.transport.SenderException; import org.apache.qpid.transport.util.Logger; +import javax.security.sasl.SaslException; +import java.nio.ByteBuffer; +import java.util.concurrent.atomic.AtomicBoolean; + public class SASLSender extends SASLEncryptor implements Sender<ByteBuffer> { protected Sender<ByteBuffer> delegate; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java index 4391e8adfc..da31c271e1 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/QpidClientX509KeyManager.java @@ -20,6 +20,11 @@ */ package org.apache.qpid.transport.network.security.ssl; +import org.apache.qpid.transport.util.Logger; + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.X509ExtendedKeyManager; import java.io.IOException; import java.net.Socket; import java.security.GeneralSecurityException; @@ -28,12 +33,6 @@ import java.security.Principal; import java.security.PrivateKey; import java.security.cert.X509Certificate; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.X509ExtendedKeyManager; - -import org.apache.qpid.transport.util.Logger; - public class QpidClientX509KeyManager extends X509ExtendedKeyManager { private static final Logger log = Logger.get(QpidClientX509KeyManager.class); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java index 8ad40bbfd3..13a16d07b5 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLReceiver.java @@ -20,19 +20,17 @@ */ package org.apache.qpid.transport.network.security.ssl; -import java.nio.ByteBuffer; +import org.apache.qpid.transport.Receiver; +import org.apache.qpid.transport.TransportException; +import org.apache.qpid.transport.network.security.SSLStatus; +import org.apache.qpid.transport.util.Logger; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngineResult; import javax.net.ssl.SSLEngineResult.HandshakeStatus; import javax.net.ssl.SSLEngineResult.Status; import javax.net.ssl.SSLException; - -import org.apache.qpid.transport.ConnectionSettings; -import org.apache.qpid.transport.Receiver; -import org.apache.qpid.transport.TransportException; -import org.apache.qpid.transport.network.security.SSLStatus; -import org.apache.qpid.transport.util.Logger; +import java.nio.ByteBuffer; public class SSLReceiver implements Receiver<ByteBuffer> { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java index 6f5aa6d86e..88943695d4 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java @@ -19,20 +19,18 @@ */ package org.apache.qpid.transport.network.security.ssl; -import java.nio.ByteBuffer; -import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.qpid.transport.Sender; +import org.apache.qpid.transport.SenderException; +import org.apache.qpid.transport.network.security.SSLStatus; +import org.apache.qpid.transport.util.Logger; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngineResult; -import javax.net.ssl.SSLException; import javax.net.ssl.SSLEngineResult.HandshakeStatus; import javax.net.ssl.SSLEngineResult.Status; - -import org.apache.qpid.transport.ConnectionSettings; -import org.apache.qpid.transport.Sender; -import org.apache.qpid.transport.SenderException; -import org.apache.qpid.transport.network.security.SSLStatus; -import org.apache.qpid.transport.util.Logger; +import javax.net.ssl.SSLException; +import java.nio.ByteBuffer; +import java.util.concurrent.atomic.AtomicBoolean; public class SSLSender implements Sender<ByteBuffer> { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java index 6bb038a581..8f01719935 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java @@ -20,6 +20,11 @@ */ package org.apache.qpid.transport.network.security.ssl; +import org.apache.qpid.transport.TransportException; +import org.apache.qpid.transport.util.Logger; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLPeerUnverifiedException; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -30,15 +35,6 @@ import java.security.Principal; import java.security.cert.Certificate; import java.security.cert.X509Certificate; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLPeerUnverifiedException; - -import org.apache.qpid.ssl.SSLContextFactory; -import org.apache.qpid.transport.ConnectionSettings; -import org.apache.qpid.transport.TransportException; -import org.apache.qpid.transport.util.Logger; - public class SSLUtil { private static final Logger log = Logger.get(SSLUtil.class); diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java index 5761228642..d76d0e249f 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java @@ -22,7 +22,7 @@ package org.apache.qpid.transport.util; import java.nio.ByteBuffer; -import static java.lang.Math.*; +import static java.lang.Math.min; /** diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java index 3db29847b2..64023c37f0 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java @@ -21,7 +21,6 @@ package org.apache.qpid.transport.util; import java.nio.ByteBuffer; - import java.util.Iterator; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java b/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java index 26cb56ea97..857d1decc4 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java @@ -20,15 +20,14 @@ */ package org.apache.qpid.url; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.qpid.exchange.ExchangeDefaults; import org.apache.qpid.framing.AMQShortString; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + +import java.net.URISyntaxException; +import java.util.HashMap; public class AMQBindingURL implements BindingURL { diff --git a/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java b/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java index 0ebfe0e869..6da468d1b8 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java @@ -21,6 +21,12 @@ package org.apache.qpid.url; */ +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.qpid.exchange.ExchangeDefaults; +import org.apache.qpid.framing.AMQShortString; + import java.net.URISyntaxException; import java.util.ArrayList; import java.util.HashMap; @@ -28,11 +34,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import org.apache.qpid.exchange.ExchangeDefaults; -import org.apache.qpid.framing.AMQShortString; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class BindingURLParser { private static final char PROPERTY_EQUALS_CHAR = '='; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java b/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java index e261860bf3..94d97d3023 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java @@ -20,7 +20,6 @@ */ package org.apache.qpid.url; -import java.util.HashMap; import java.util.Map; public class URLHelper diff --git a/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java b/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java index 09478d4157..cb276a70e5 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java @@ -26,7 +26,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.regex.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * CommandLineParser provides a utility for specifying the format of a command line and parsing command lines to ensure diff --git a/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java b/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java index 8ad9d00f54..7961e4ba3c 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java @@ -23,8 +23,6 @@ package org.apache.qpid.util; import java.util.Comparator; -import org.apache.qpid.SerialException; - /** * This class provides basic serial number comparisons as defined in * RFC 1982. diff --git a/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java b/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java index fe1a300479..da3aab3192 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java @@ -21,7 +21,6 @@ package org.apache.qpid.util; import java.io.UnsupportedEncodingException; - import java.util.Arrays; import java.util.Map; import java.util.Properties; diff --git a/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java b/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java index 4564b1d686..de48925076 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java @@ -21,14 +21,17 @@ package org.apache.qpid.util.concurrent; */ -import java.util.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.AbstractQueue; +import java.util.Collection; +import java.util.Iterator; +import java.util.Queue; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Synchronous/Asynchronous puts. Asynchronous is easiest, just wait till can write to queue and deposit data. diff --git a/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java b/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java index f65427e583..575058b7f8 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java @@ -21,9 +21,10 @@ package org.apache.qpid; import junit.framework.TestCase; -import org.apache.qpid.protocol.AMQConstant; + import org.apache.qpid.framing.AMQFrameDecodingException; import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.protocol.AMQConstant; /** * This test is to ensure that when an AMQException is rethrown that the specified exception is correctly wrapped up. diff --git a/qpid/java/common/src/test/java/org/apache/qpid/codec/AMQDecoderTest.java b/qpid/java/common/src/test/java/org/apache/qpid/codec/AMQDecoderTest.java index 272eb75800..6540e053b1 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/codec/AMQDecoderTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/codec/AMQDecoderTest.java @@ -21,12 +21,6 @@ package org.apache.qpid.codec; */ -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.ArrayList; - import junit.framework.TestCase; import org.apache.qpid.framing.AMQDataBlock; @@ -35,6 +29,12 @@ import org.apache.qpid.framing.AMQFrameDecodingException; import org.apache.qpid.framing.AMQProtocolVersionException; import org.apache.qpid.framing.HeartbeatBody; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; + public class AMQDecoderTest extends TestCase { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java b/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java index 401848c21d..3a95ca330f 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/codec/MockAMQVersionAwareProtocolSession.java @@ -21,8 +21,6 @@ package org.apache.qpid.codec; */ -import java.nio.ByteBuffer; - import org.apache.qpid.AMQException; import org.apache.qpid.framing.AMQDataBlock; import org.apache.qpid.framing.AMQMethodBody; @@ -34,6 +32,8 @@ import org.apache.qpid.framing.ProtocolVersion; import org.apache.qpid.protocol.AMQVersionAwareProtocolSession; import org.apache.qpid.transport.Sender; +import java.nio.ByteBuffer; + public class MockAMQVersionAwareProtocolSession implements AMQVersionAwareProtocolSession { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java b/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java index 9a805d87b3..bcdabfcb3f 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java @@ -20,11 +20,11 @@ package org.apache.qpid.framing; +import junit.framework.TestCase; + import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; - -import junit.framework.TestCase; public class AMQShortStringTest extends TestCase { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java b/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java index 5e7783f492..4818ecc3d3 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java @@ -22,7 +22,11 @@ package org.apache.qpid.framing; import junit.framework.TestCase; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; public class BasicContentHeaderPropertiesTest extends TestCase diff --git a/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java b/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java index cb9a9468bb..16f35613d8 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java @@ -20,19 +20,19 @@ */ package org.apache.qpid.framing; +import junit.framework.Assert; +import junit.framework.TestCase; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.qpid.AMQPInvalidClassException; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.qpid.AMQPInvalidClassException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class PropertyFieldTableTest extends TestCase { private static final Logger _logger = LoggerFactory.getLogger(PropertyFieldTableTest.class); diff --git a/qpid/java/common/src/test/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImplTest.java b/qpid/java/common/src/test/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImplTest.java index 3243136287..ad075ff0c2 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImplTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/framing/abstraction/MessagePublishInfoImplTest.java @@ -21,8 +21,8 @@ package org.apache.qpid.framing.abstraction; import junit.framework.TestCase; + import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; public class MessagePublishInfoImplTest extends TestCase { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/pool/ReferenceCountingExecutorServiceTest.java b/qpid/java/common/src/test/java/org/apache/qpid/pool/ReferenceCountingExecutorServiceTest.java index 35998de3a1..de73a2ff88 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/pool/ReferenceCountingExecutorServiceTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/pool/ReferenceCountingExecutorServiceTest.java @@ -20,14 +20,14 @@ */ package org.apache.qpid.pool; +import junit.framework.TestCase; + import java.util.HashSet; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; -import junit.framework.TestCase; - public class ReferenceCountingExecutorServiceTest extends TestCase { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java b/qpid/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java index 288946e064..c373da0887 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/ssl/SSLContextFactoryTest.java @@ -17,11 +17,10 @@ */ package org.apache.qpid.ssl; -import java.io.IOException; +import org.apache.qpid.test.utils.QpidTestCase; import javax.net.ssl.SSLContext; - -import org.apache.qpid.test.utils.QpidTestCase; +import java.io.IOException; public class SSLContextFactoryTest extends QpidTestCase { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java b/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java index e69f95f916..94db7d8dde 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java @@ -20,19 +20,22 @@ */ package org.apache.qpid.test.utils; +import junit.framework.TestCase; +import junit.framework.TestResult; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.net.DatagramSocket; import java.net.ServerSocket; -import java.util.*; - -import junit.framework.TestCase; -import junit.framework.TestResult; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; public class QpidTestCase extends TestCase diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java index 49f6a08007..d22e806dd6 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java @@ -20,6 +20,11 @@ */ package org.apache.qpid.transport; +import org.apache.qpid.test.utils.QpidTestCase; +import org.apache.qpid.transport.network.ConnectionBinding; +import org.apache.qpid.transport.network.io.IoAcceptor; +import org.apache.qpid.transport.util.Waiter; + import static org.apache.qpid.transport.Option.EXPECTED; import static org.apache.qpid.transport.Option.NONE; import static org.apache.qpid.transport.Option.SYNC; @@ -31,11 +36,6 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.apache.qpid.test.utils.QpidTestCase; -import org.apache.qpid.transport.network.ConnectionBinding; -import org.apache.qpid.transport.network.io.IoAcceptor; -import org.apache.qpid.transport.util.Waiter; - /** * ConnectionTest */ diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java index 889250e004..56dbaf5535 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java @@ -20,14 +20,15 @@ */ package org.apache.qpid.transport; +import junit.framework.TestCase; + +import static org.apache.qpid.util.Serial.COMPARATOR; +import static org.apache.qpid.util.Serial.eq; + import java.util.ArrayList; import java.util.Collections; import java.util.List; -import junit.framework.TestCase; - -import static org.apache.qpid.util.Serial.*; - /** * RangeSetTest * diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java index 8533c64fab..85e5405c97 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/TestNetworkConnection.java @@ -20,17 +20,17 @@ */ package org.apache.qpid.transport; +import org.apache.qpid.protocol.ProtocolEngine; +import org.apache.qpid.protocol.ProtocolEngineFactory; +import org.apache.qpid.ssl.SSLContextFactory; +import org.apache.qpid.transport.network.NetworkConnection; + import java.net.BindException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.ByteBuffer; -import org.apache.qpid.protocol.ProtocolEngine; -import org.apache.qpid.protocol.ProtocolEngineFactory; -import org.apache.qpid.ssl.SSLContextFactory; -import org.apache.qpid.transport.network.NetworkConnection; - /** * Test implementation of IoSession, which is required for some tests. Methods not being used are not implemented, * so if this class is being used and some methods are to be used, then please update those. diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/network/TransportTest.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/network/TransportTest.java index 7039b904e3..c882d3437e 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/network/TransportTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/network/TransportTest.java @@ -21,10 +21,6 @@ package org.apache.qpid.transport.network; -import java.nio.ByteBuffer; - -import javax.net.ssl.SSLContext; - import org.apache.qpid.framing.ProtocolVersion; import org.apache.qpid.protocol.ProtocolEngineFactory; import org.apache.qpid.test.utils.QpidTestCase; @@ -34,6 +30,9 @@ import org.apache.qpid.transport.Receiver; import org.apache.qpid.transport.TransportException; import org.apache.qpid.transport.network.io.IoNetworkTransport; +import javax.net.ssl.SSLContext; +import java.nio.ByteBuffer; + public class TransportTest extends QpidTestCase { diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoAcceptor.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoAcceptor.java index e075681acb..641bc5fa34 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoAcceptor.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoAcceptor.java @@ -24,12 +24,10 @@ import org.apache.qpid.transport.Binding; import org.apache.qpid.transport.TransportException; import java.io.IOException; - import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketAddress; - import java.nio.ByteBuffer; diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java index 215c6d9931..e9005ab2e4 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/network/io/IoTransport.java @@ -19,13 +19,13 @@ package org.apache.qpid.transport.network.io; -import java.net.Socket; -import java.nio.ByteBuffer; - import org.apache.qpid.transport.Binding; import org.apache.qpid.transport.Sender; import org.apache.qpid.transport.util.Logger; +import java.net.Socket; +import java.nio.ByteBuffer; + /** * This class provides a socket based transport using the java.io * classes. diff --git a/qpid/java/common/src/test/java/org/apache/qpid/util/ByteBufferInputStreamTest.java b/qpid/java/common/src/test/java/org/apache/qpid/util/ByteBufferInputStreamTest.java index 0b393a489f..53626b6658 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/util/ByteBufferInputStreamTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/util/ByteBufferInputStreamTest.java @@ -20,12 +20,12 @@ */ package org.apache.qpid.util; +import junit.framework.TestCase; + import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; -import junit.framework.TestCase; - public class ByteBufferInputStreamTest extends TestCase { private byte[] _data = {2, 1, 5, 3, 4}; diff --git a/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java b/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java index 942901f1c0..7ba5038faa 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java @@ -21,8 +21,9 @@ package org.apache.qpid.util; -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java b/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java index b2578563e0..ef8e7de61c 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java @@ -23,10 +23,6 @@ package org.apache.qpid.util; import junit.framework.TestCase; -import java.util.Random; - -import org.apache.qpid.SerialException; - /** *Junit tests for the Serial class */ diff --git a/qpid/java/common/templates/method/version/MethodBodyClass.vm b/qpid/java/common/templates/method/version/MethodBodyClass.vm index 0e444b87df..caa7277d22 100644 --- a/qpid/java/common/templates/method/version/MethodBodyClass.vm +++ b/qpid/java/common/templates/method/version/MethodBodyClass.vm @@ -2,9 +2,6 @@ #set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" ) #end #macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end - - - #set( $amqp_ClassName = $amqpClass.Name) #UpperCamel( $amqp_ClassName ) #set( $amqp_MethodName = $amqpMethod.Name ) @@ -12,7 +9,6 @@ #set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}BodyImpl" ) #set( $interfaceName = "${amqp_ClassName}${amqp_MethodName}Body" ) #set( $amqpPackageName = "amqp_$version.getMajor()_$version.getMinor()" ) - #set( $filename = "${amqpPackageName}/${javaClassName}.java") /* * @@ -46,11 +42,9 @@ package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor(); -import java.io.DataInput; import org.apache.qpid.codec.MarkableDataInput; import java.io.DataOutput; import java.io.IOException; -import java.util.HashMap; import org.apache.qpid.framing.*; import org.apache.qpid.AMQException; diff --git a/qpid/java/common/templates/model/MethodDispatcherInterface.vm b/qpid/java/common/templates/model/MethodDispatcherInterface.vm index ff14715fef..a2c6328c4e 100644 --- a/qpid/java/common/templates/model/MethodDispatcherInterface.vm +++ b/qpid/java/common/templates/model/MethodDispatcherInterface.vm @@ -30,10 +30,7 @@ package org.apache.qpid.framing;
-import org.apache.qpid.AMQException;
-
-
public interface MethodDispatcher extends
ClientMethodDispatcher, ServerMethodDispatcher
{
-}
\ No newline at end of file +}
diff --git a/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm b/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm index 8a7b667a91..272ceff915 100644 --- a/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm +++ b/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm @@ -30,14 +30,12 @@ package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor(); -import org.apache.qpid.AMQException; import org.apache.qpid.framing.*; - public interface MethodDispatcher_${version.getMajor()}_${version.getMinor()} extends MethodDispatcher, ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()}, ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()} { -}
\ No newline at end of file +} |