Remove unnecessary casts
This commit is contained in:
parent
b0815c6a4e
commit
429e1e84d4
|
@ -374,7 +374,7 @@ public class ClientProducerImpl implements ClientProducerInternal {
|
|||
for (long pos = 0; pos < bodySize; ) {
|
||||
final boolean lastChunk;
|
||||
|
||||
final int chunkLength = (int) Math.min((bodySize - pos), (long) minLargeMessageSize);
|
||||
final int chunkLength = (int) Math.min((bodySize - pos), minLargeMessageSize);
|
||||
|
||||
final ActiveMQBuffer bodyBuffer = ActiveMQBuffers.fixedBuffer(chunkLength);
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver {
|
|||
if (rs.next()) {
|
||||
Blob blob = rs.getBlob(1);
|
||||
readLength = (int) calculateReadLength(blob.length(), bytes.remaining(), file.position());
|
||||
byte[] data = blob.getBytes(file.position() + 1, (int) readLength);
|
||||
byte[] data = blob.getBytes(file.position() + 1, readLength);
|
||||
bytes.put(data);
|
||||
}
|
||||
connection.commit();
|
||||
|
|
|
@ -146,7 +146,7 @@ final class MappedFile implements AutoCloseable {
|
|||
* then the position is updated with the number of bytes actually read.
|
||||
*/
|
||||
public int read(ByteBuf dst, int dstStart, int dstLength) throws IOException {
|
||||
final int remaining = (int) Math.min(this.length - this.position, (long) Integer.MAX_VALUE);
|
||||
final int remaining = (int) Math.min(this.length - this.position, Integer.MAX_VALUE);
|
||||
final int read = Math.min(remaining, dstLength);
|
||||
final int bufferPosition = checkOffset(position, read);
|
||||
final long srcAddress = PlatformDependent.directBufferAddress(lastMapped) + bufferPosition;
|
||||
|
@ -172,7 +172,7 @@ final class MappedFile implements AutoCloseable {
|
|||
* then the position is updated with the number of bytes actually read.
|
||||
*/
|
||||
public int read(ByteBuffer dst, int dstStart, int dstLength) throws IOException {
|
||||
final int remaining = (int) Math.min(this.length - this.position, (long) Integer.MAX_VALUE);
|
||||
final int remaining = (int) Math.min(this.length - this.position, Integer.MAX_VALUE);
|
||||
final int read = Math.min(remaining, dstLength);
|
||||
final int bufferPosition = checkOffset(position, read);
|
||||
final long srcAddress = PlatformDependent.directBufferAddress(lastMapped) + bufferPosition;
|
||||
|
|
|
@ -217,7 +217,7 @@ public class FanoutTransportBrokerTest extends OpenwireArtemisBaseTest {
|
|||
|
||||
// The MockTransport is on the remote connection.
|
||||
// Slip in a new transport filter after the MockTransport
|
||||
MockTransport mt = (MockTransport) connection3.getTransport().narrow(MockTransport.class);
|
||||
MockTransport mt = connection3.getTransport().narrow(MockTransport.class);
|
||||
mt.install(new TransportFilter(mt.getNext()) {
|
||||
@Override
|
||||
public void oneway(Object command) throws IOException {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class FailureXATest extends ActiveMQTestBase {
|
|||
|
||||
private void doTestCrashServerAfterXACommit(boolean onePhase) throws Exception {
|
||||
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
|
||||
XAConnection connection = (XAConnection) connectionFactory.createXAConnection();
|
||||
XAConnection connection = connectionFactory.createXAConnection();
|
||||
|
||||
try {
|
||||
Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SendingAndReceivingTest extends ActiveMQTestBase {
|
|||
private static String createMessage(int messageSize) {
|
||||
final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
Random rnd = new Random();
|
||||
StringBuilder sb = new StringBuilder((int) messageSize);
|
||||
StringBuilder sb = new StringBuilder(messageSize);
|
||||
for (int j = 0; j < messageSize; j++ ) {
|
||||
sb.append(AB.charAt(rnd.nextInt(AB.length())));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue