diff --git a/src/org/ice4j/attribute/AttributeFactory.java b/src/org/ice4j/attribute/AttributeFactory.java
index 39b145f..11a605d 100644
--- a/src/org/ice4j/attribute/AttributeFactory.java
+++ b/src/org/ice4j/attribute/AttributeFactory.java
@@ -6,6 +6,9 @@
*/
package org.ice4j.attribute;
+import java.io.*;
+import java.lang.reflect.*;
+
import org.ice4j.*;
/**
@@ -315,17 +318,23 @@ public class AttributeFactory
}
/**
- * Create a UsernameAttribute.
+ * Creates a new UsernameAttribute instance.
*
* @param username the String value of the username
- *
- * @return newly created UsernameAttribute
+ * @return a new UsernameAttribute instance
*/
public static UsernameAttribute createUsernameAttribute(String username)
{
UsernameAttribute attribute = new UsernameAttribute();
- attribute.setUsername(username.getBytes());
+ try
+ {
+ attribute.setUsername(username.getBytes("UTF-8"));
+ }
+ catch (UnsupportedEncodingException ueex)
+ {
+ throw new UndeclaredThrowableException(ueex);
+ }
return attribute;
}
@@ -345,8 +354,8 @@ public class AttributeFactory
String username)
{
MessageIntegrityAttribute attribute = new MessageIntegrityAttribute();
- attribute.setUsername(username);
+ attribute.setUsername(username);
return attribute;
};
diff --git a/src/org/ice4j/attribute/MessageIntegrityAttribute.java b/src/org/ice4j/attribute/MessageIntegrityAttribute.java
index 76e2823..3a2743b 100644
--- a/src/org/ice4j/attribute/MessageIntegrityAttribute.java
+++ b/src/org/ice4j/attribute/MessageIntegrityAttribute.java
@@ -162,14 +162,15 @@ public class MessageIntegrityAttribute
throws IllegalArgumentException
{
byte[] hmac;
+
try
{
// get an HMAC-SHA1 key from the raw key bytes
SecretKeySpec signingKey
= new SecretKeySpec(key, HMAC_SHA1_ALGORITHM);
-
// get an HMAC-SHA1 Mac instance and initialize it with the key
Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM);
+
mac.init(signingKey);
// compute the hmac on input data bytes
@@ -179,7 +180,6 @@ public class MessageIntegrityAttribute
//so we'd need to create an array that only contains what we
//actually need to work with.
System.arraycopy(message, offset, macInput, 0, length);
-
hmac = mac.doFinal(macInput);
}
catch (Exception exc)
@@ -187,7 +187,6 @@ public class MessageIntegrityAttribute
throw new IllegalArgumentException(
"Could not create HMAC-SHA1 request encoding: ", exc);
}
-
return hmac;
}
diff --git a/src/org/ice4j/ice/Candidate.java b/src/org/ice4j/ice/Candidate.java
index 3dd29a7..674d3cd 100644
--- a/src/org/ice4j/ice/Candidate.java
+++ b/src/org/ice4j/ice/Candidate.java
@@ -74,7 +74,7 @@ public abstract class Candidate
* however (that is when running a more recent JVM) we will reflect it in
* this property.
*/
- private boolean isVirtual = false;
+ private boolean virtual = false;
/**
* The component that this candidate was created for. Every candidate is
@@ -461,7 +461,7 @@ public abstract class Candidate
*/
public boolean isVirtual()
{
- return isVirtual;
+ return virtual;
}
/**
@@ -478,9 +478,9 @@ public abstract class Candidate
* address associated with this Candidate comes from a virtual
* interface and false if otherwise.
*/
- public void setVirtual(boolean isVirtual)
+ public void setVirtual(boolean virtual)
{
- this.isVirtual = isVirtual;
+ this.virtual = virtual;
}
/**
diff --git a/src/org/ice4j/ice/CandidatePair.java b/src/org/ice4j/ice/CandidatePair.java
index fd3d77a..9e0ea33 100644
--- a/src/org/ice4j/ice/CandidatePair.java
+++ b/src/org/ice4j/ice/CandidatePair.java
@@ -135,7 +135,7 @@ public class CandidatePair
*/
protected void setLocalCandidate( LocalCandidate localCnd)
{
- this.localCandidate = localCnd;;
+ this.localCandidate = localCnd;
}
/**
@@ -156,7 +156,7 @@ public class CandidatePair
*/
protected void setRemoteCandidate( Candidate remoteCnd)
{
- this.remoteCandidate = remoteCnd;;
+ this.remoteCandidate = remoteCnd;
}
/**