Fixes warnings.
This commit is contained in:
parent
0b2d7d4144
commit
605332bbe1
@ -35,7 +35,6 @@ import org.ice4j.*;
|
||||
* @author Emil Ivov
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
public class UnknownAttributesAttribute extends Attribute
|
||||
{
|
||||
/**
|
||||
@ -151,9 +150,9 @@ public class UnknownAttributesAttribute extends Attribute
|
||||
binValue[offset++] = (byte) (getDataLength() & 0x00FF);
|
||||
|
||||
|
||||
Iterator attributes = getAttributes();
|
||||
Iterator<Character> attributes = getAttributes();
|
||||
while (attributes.hasNext()) {
|
||||
char att = ((Character)attributes.next()).charValue();
|
||||
char att = attributes.next().charValue();
|
||||
binValue[offset++] = (byte)(att>>8);
|
||||
binValue[offset++] = (byte)(att & 0x00FF);
|
||||
}
|
||||
@ -224,7 +223,5 @@ public class UnknownAttributesAttribute extends Attribute
|
||||
(attributeValue[offset++]) );
|
||||
addAttributeID(attributeID);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -380,8 +380,7 @@ public class NetworkUtils
|
||||
{
|
||||
try
|
||||
{
|
||||
Method method
|
||||
= iface.getClass().getMethod("isLoopback", new Class[]{});
|
||||
Method method = iface.getClass().getMethod("isLoopback");
|
||||
|
||||
return ((Boolean)method.invoke(iface, new Object[]{}))
|
||||
.booleanValue();
|
||||
@ -413,11 +412,9 @@ public class NetworkUtils
|
||||
{
|
||||
try
|
||||
{
|
||||
Method method
|
||||
= iface.getClass().getMethod("isUp", new Class[]{});
|
||||
Method method = iface.getClass().getMethod("isUp");
|
||||
|
||||
return ((Boolean)method.invoke(iface, new Object[]{}))
|
||||
.booleanValue();
|
||||
return ((Boolean)method.invoke(iface)).booleanValue();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
@ -445,11 +442,9 @@ public class NetworkUtils
|
||||
{
|
||||
try
|
||||
{
|
||||
Method method
|
||||
= iface.getClass().getMethod("isVirtual", new Class[]{});
|
||||
Method method = iface.getClass().getMethod("isVirtual");
|
||||
|
||||
return ((Boolean)method.invoke(iface, new Object[]{}))
|
||||
.booleanValue();
|
||||
return ((Boolean)method.invoke(iface)).booleanValue();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
|
||||
@ -243,17 +243,15 @@ public abstract class Message
|
||||
public char getDataLength()
|
||||
{
|
||||
char length = 0;
|
||||
Attribute att = null;
|
||||
|
||||
Iterator iter = attributes.entrySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
att = (Attribute)((Map.Entry)iter.next()).getValue();
|
||||
for (Attribute att : attributes.values())
|
||||
{
|
||||
length += att.getDataLength() + Attribute.HEADER_LENGTH;
|
||||
}
|
||||
|
||||
if((length % 4) > 0)
|
||||
{
|
||||
length += (4 - (length % 4));
|
||||
length += (4 - (length % 4));
|
||||
}
|
||||
|
||||
return length;
|
||||
@ -484,10 +482,8 @@ public abstract class Message
|
||||
return false;
|
||||
|
||||
//compare attributes
|
||||
Iterator iter = attributes.entrySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Attribute localAtt = (Attribute)((Map.Entry)iter.next()).getValue();
|
||||
|
||||
for (Attribute localAtt : attributes.values())
|
||||
{
|
||||
if(!localAtt.equals(msg.getAttribute(localAtt.getAttributeType())))
|
||||
return false;
|
||||
}
|
||||
@ -495,7 +491,6 @@ public abstract class Message
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns 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);
|
||||
offset+=TRANSACTION_ID_LENGTH;
|
||||
|
||||
Iterator iter = attributes.entrySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
|
||||
Attribute attribute = (Attribute)((Map.Entry)iter.next()).getValue();
|
||||
|
||||
for (Attribute attribute : attributes.values())
|
||||
{
|
||||
byte[] attBinValue = attribute.encode();
|
||||
System.arraycopy(attBinValue, 0, binMsg, offset, attBinValue.length);
|
||||
offset += attBinValue.length;
|
||||
|
||||
@ -357,7 +357,7 @@ public class TransactionSupportTests extends TestCase
|
||||
requestCollector.waitForRequest();
|
||||
|
||||
//verify
|
||||
Vector reqs = requestCollector.getRequestsForTransaction(
|
||||
Vector<?> reqs = requestCollector.getRequestsForTransaction(
|
||||
bindingRequest.getTransactionID());
|
||||
assertTrue("A retransmissions of the request was sent too early",
|
||||
reqs.size() < 2);
|
||||
|
||||
@ -82,13 +82,11 @@ public class Ice
|
||||
{
|
||||
try
|
||||
{
|
||||
Method method
|
||||
= iface.getClass().getMethod("isLoopback", new Class[]{});
|
||||
Method method = iface.getClass().getMethod("isLoopback");
|
||||
|
||||
System.out.println("It works!");
|
||||
|
||||
return ((Boolean)method.invoke(iface, new Object[]{}))
|
||||
.booleanValue();
|
||||
return ((Boolean)method.invoke(iface)).booleanValue();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
@ -107,13 +105,11 @@ public class Ice
|
||||
{
|
||||
try
|
||||
{
|
||||
Method method
|
||||
= iface.getClass().getMethod("isUp", new Class[]{});
|
||||
Method method = iface.getClass().getMethod("isUp");
|
||||
|
||||
System.out.println("It works!");
|
||||
|
||||
return ((Boolean)method.invoke(iface, new Object[]{}))
|
||||
.booleanValue();
|
||||
return ((Boolean)method.invoke(iface)).booleanValue();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
@ -129,13 +125,11 @@ public class Ice
|
||||
{
|
||||
try
|
||||
{
|
||||
Method method
|
||||
= iface.getClass().getMethod("isVirtual", new Class[]{});
|
||||
Method method = iface.getClass().getMethod("isVirtual");
|
||||
|
||||
System.out.println("It works!");
|
||||
|
||||
return ((Boolean)method.invoke(iface, new Object[]{}))
|
||||
.booleanValue();
|
||||
return ((Boolean)method.invoke(iface)).booleanValue();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user