Fixes warnings.

This commit is contained in:
lubomir.marinov 2010-02-10 22:02:23 +00:00
parent 0b2d7d4144
commit 605332bbe1
5 changed files with 21 additions and 43 deletions

View File

@ -35,7 +35,6 @@ import org.ice4j.*;
* @author Emil Ivov * @author Emil Ivov
* @version 0.1 * @version 0.1
*/ */
public class UnknownAttributesAttribute extends Attribute public class UnknownAttributesAttribute extends Attribute
{ {
/** /**
@ -151,9 +150,9 @@ public class UnknownAttributesAttribute extends Attribute
binValue[offset++] = (byte) (getDataLength() & 0x00FF); binValue[offset++] = (byte) (getDataLength() & 0x00FF);
Iterator attributes = getAttributes(); Iterator<Character> attributes = getAttributes();
while (attributes.hasNext()) { while (attributes.hasNext()) {
char att = ((Character)attributes.next()).charValue(); char att = attributes.next().charValue();
binValue[offset++] = (byte)(att>>8); binValue[offset++] = (byte)(att>>8);
binValue[offset++] = (byte)(att & 0x00FF); binValue[offset++] = (byte)(att & 0x00FF);
} }
@ -224,7 +223,5 @@ public class UnknownAttributesAttribute extends Attribute
(attributeValue[offset++]) ); (attributeValue[offset++]) );
addAttributeID(attributeID); addAttributeID(attributeID);
} }
} }
} }

View File

@ -380,8 +380,7 @@ public class NetworkUtils
{ {
try try
{ {
Method method Method method = iface.getClass().getMethod("isLoopback");
= iface.getClass().getMethod("isLoopback", new Class[]{});
return ((Boolean)method.invoke(iface, new Object[]{})) return ((Boolean)method.invoke(iface, new Object[]{}))
.booleanValue(); .booleanValue();
@ -413,11 +412,9 @@ public class NetworkUtils
{ {
try try
{ {
Method method Method method = iface.getClass().getMethod("isUp");
= iface.getClass().getMethod("isUp", new Class[]{});
return ((Boolean)method.invoke(iface, new Object[]{})) return ((Boolean)method.invoke(iface)).booleanValue();
.booleanValue();
} }
catch(Throwable t) catch(Throwable t)
{ {
@ -445,11 +442,9 @@ public class NetworkUtils
{ {
try try
{ {
Method method Method method = iface.getClass().getMethod("isVirtual");
= iface.getClass().getMethod("isVirtual", new Class[]{});
return ((Boolean)method.invoke(iface, new Object[]{})) return ((Boolean)method.invoke(iface)).booleanValue();
.booleanValue();
} }
catch(Throwable t) catch(Throwable t)
{ {

View File

@ -243,11 +243,9 @@ public abstract class Message
public char getDataLength() public char getDataLength()
{ {
char length = 0; char length = 0;
Attribute att = null;
Iterator iter = attributes.entrySet().iterator(); for (Attribute att : attributes.values())
while (iter.hasNext()) { {
att = (Attribute)((Map.Entry)iter.next()).getValue();
length += att.getDataLength() + Attribute.HEADER_LENGTH; length += att.getDataLength() + Attribute.HEADER_LENGTH;
} }
@ -484,10 +482,8 @@ public abstract class Message
return false; return false;
//compare attributes //compare attributes
Iterator iter = attributes.entrySet().iterator(); for (Attribute localAtt : attributes.values())
while (iter.hasNext()) { {
Attribute localAtt = (Attribute)((Map.Entry)iter.next()).getValue();
if(!localAtt.equals(msg.getAttribute(localAtt.getAttributeType()))) if(!localAtt.equals(msg.getAttribute(localAtt.getAttributeType())))
return false; return false;
} }
@ -495,7 +491,6 @@ public abstract class Message
return true; return true;
} }
/** /**
* Returns a binary representation of this message. * Returns a binary representation of this message.
* @return a binary representation of this message. * @return a binary representation of this message.
@ -522,11 +517,8 @@ public abstract class Message
System.arraycopy(getTransactionID(), 0, binMsg, offset, TRANSACTION_ID_LENGTH); System.arraycopy(getTransactionID(), 0, binMsg, offset, TRANSACTION_ID_LENGTH);
offset+=TRANSACTION_ID_LENGTH; offset+=TRANSACTION_ID_LENGTH;
Iterator iter = attributes.entrySet().iterator(); for (Attribute attribute : attributes.values())
while (iter.hasNext()) { {
Attribute attribute = (Attribute)((Map.Entry)iter.next()).getValue();
byte[] attBinValue = attribute.encode(); byte[] attBinValue = attribute.encode();
System.arraycopy(attBinValue, 0, binMsg, offset, attBinValue.length); System.arraycopy(attBinValue, 0, binMsg, offset, attBinValue.length);
offset += attBinValue.length; offset += attBinValue.length;

View File

@ -357,7 +357,7 @@ public class TransactionSupportTests extends TestCase
requestCollector.waitForRequest(); requestCollector.waitForRequest();
//verify //verify
Vector reqs = requestCollector.getRequestsForTransaction( Vector<?> reqs = requestCollector.getRequestsForTransaction(
bindingRequest.getTransactionID()); bindingRequest.getTransactionID());
assertTrue("A retransmissions of the request was sent too early", assertTrue("A retransmissions of the request was sent too early",
reqs.size() < 2); reqs.size() < 2);

View File

@ -82,13 +82,11 @@ public class Ice
{ {
try try
{ {
Method method Method method = iface.getClass().getMethod("isLoopback");
= iface.getClass().getMethod("isLoopback", new Class[]{});
System.out.println("It works!"); System.out.println("It works!");
return ((Boolean)method.invoke(iface, new Object[]{})) return ((Boolean)method.invoke(iface)).booleanValue();
.booleanValue();
} }
catch(Throwable t) catch(Throwable t)
{ {
@ -107,13 +105,11 @@ public class Ice
{ {
try try
{ {
Method method Method method = iface.getClass().getMethod("isUp");
= iface.getClass().getMethod("isUp", new Class[]{});
System.out.println("It works!"); System.out.println("It works!");
return ((Boolean)method.invoke(iface, new Object[]{})) return ((Boolean)method.invoke(iface)).booleanValue();
.booleanValue();
} }
catch(Throwable t) catch(Throwable t)
{ {
@ -129,13 +125,11 @@ public class Ice
{ {
try try
{ {
Method method Method method = iface.getClass().getMethod("isVirtual");
= iface.getClass().getMethod("isVirtual", new Class[]{});
System.out.println("It works!"); System.out.println("It works!");
return ((Boolean)method.invoke(iface, new Object[]{})) return ((Boolean)method.invoke(iface)).booleanValue();
.booleanValue();
} }
catch(Throwable t) catch(Throwable t)
{ {