Fixes warnings.
This commit is contained in:
parent
0b2d7d4144
commit
605332bbe1
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -243,17 +243,15 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((length % 4) > 0)
|
if((length % 4) > 0)
|
||||||
{
|
{
|
||||||
length += (4 - (length % 4));
|
length += (4 - (length % 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
return length;
|
return 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;
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user