Fixes warnings.

cusax-fix
Lyubomir Marinov 13 years ago
parent 74c2b852d1
commit d18143cf6d

@ -1043,9 +1043,14 @@ private static String getThumbprint(Certificate cert, String algorithm)
byte[] encodedCert = cert.getEncoded();
StringBuilder sb = new StringBuilder(encodedCert.length * 2);
Formatter f = new Formatter(sb);
for (byte b : digest.digest(encodedCert))
try
{
for (byte b : digest.digest(encodedCert))
f.format("%02x", b);
}
finally
{
f.format("%02x", b);
f.close();
}
return sb.toString();
}

@ -150,7 +150,7 @@ public void commitPage()
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizardPage}
*/
public void changedUpdate(@SuppressWarnings("unused") DocumentEvent e)
public void changedUpdate(DocumentEvent e)
{
}

@ -49,7 +49,7 @@ public AutoAnswerMenu()
loadSkin();
this.registerMenuItems(this);
registerMenuItems(this);
}
/**

@ -139,8 +139,7 @@ public void publishStatus(
else
{
loginManager.setManuallyDisconnected(true);
GuiActivator.getUIService().getLoginManager()
.logoff(protocolProvider);
LoginManager.logoff(protocolProvider);
}
}
else if (registrationState != RegistrationState.REGISTERED
@ -156,8 +155,7 @@ else if (!status.isOnline()
== RegistrationState.UNREGISTERING))
{
loginManager.setManuallyDisconnected(true);
GuiActivator.getUIService().getLoginManager()
.logoff(protocolProvider);
LoginManager.logoff(protocolProvider);
}
if(rememberStatus)
@ -247,8 +245,7 @@ else if (itemName.equals(GlobalStatusEnum.OFFLINE_STATUS))
saveStatusInformation( protocolProvider,
itemName);
GuiActivator.getUIService().getLoginManager()
.logoff(protocolProvider);
LoginManager.logoff(protocolProvider);
continue;
}

@ -535,9 +535,17 @@ public void actionPerformed(ActionEvent e)
lastAvatarDir = file.getParentFile();
FileInputStream in = new FileInputStream(file);
byte buffer[] = new byte[in.available()];
in.read(buffer);
byte[] buffer;
try
{
buffer = new byte[in.available()];
in.read(buffer);
}
finally
{
in.close();
}
if (buffer == null || buffer.length <= 0)
return;

@ -264,12 +264,21 @@ private static boolean isOurCrashLog(File file)
try
{
BufferedReader reader = new BufferedReader(new FileReader(file));
String line = null;
while((line = reader.readLine()) != null)
if(JAVA_ERROR_LOG_PATTERN.matcher(line).find())
return true;
try
{
String line;
while((line = reader.readLine()) != null)
if(JAVA_ERROR_LOG_PATTERN.matcher(line).find())
return true;
}
finally
{
reader.close();
}
}
catch(Throwable e)
catch(Throwable t)
{}
return false;

@ -2065,12 +2065,27 @@ private void releasedImage()
try
{
lastDir = file.getParentFile();
FileInputStream in = new FileInputStream(file);
byte buffer[] = new byte[in.available()];
in.read(buffer);
WhiteboardShapeImage image =
new WhiteboardShapeImage(id(), new WhiteboardPoint(drawX,
drawY), originWidth, originHeight, buffer);
byte[] buffer;
try
{
buffer = new byte[in.available()];
in.read(buffer);
}
finally
{
in.close();
}
WhiteboardShapeImage image
= new WhiteboardShapeImage(
id(),
new WhiteboardPoint(drawX, drawY),
originWidth, originHeight,
buffer);
appendAndSend(image);
}
catch (IOException ex)

@ -162,6 +162,9 @@ public static int decode(
return encoder.decode(data, out);
}
/** Prevents the initialization of <tt>Base64</tt> instances. */
private Base64() {}
public static class Base64Encoder
{
protected final byte[] encodingTable =
@ -471,5 +474,4 @@ private int nextI(String data, int i, int finish)
return i;
}
}
}
}

@ -428,9 +428,9 @@ public void waitForEvent(long waitFor)
}
//the follwoing methods only have dummy implementations here as they
//do not interest us. complete implementatios are provider in the
//basic instant messaging operation set.
// The following methods only have dummy implementations here as they do
// not interest us. Complete implementations are provided in the basic
// instant messaging operation set.
public void buddyInfoUpdated(IcbmService service, Screenname buddy,
IcbmBuddyInfo info){}
public void conversationClosed(Conversation c){}

@ -141,7 +141,7 @@ public void testInstallationPersistency() throws Exception
= fixture.findProtocolProviderBundle(fixture.provider1);
//set the global providerBundle reference that we will be using
//in the last series of tests (Account uninstallation persistency)
//in the last series of tests (Account uninstallation persistence)
SipSlickFixture.providerBundle = providerBundle;
assertNotNull("Couldn't find a bundle for the tested provider"

@ -17,8 +17,6 @@
*/
public class TestBase64 extends TestCase
{
private Base64 base64 = null;
/**
* Create a TestBase64 wrapper over the test with the specified name.
* @param name the name of the test to run
@ -35,8 +33,6 @@ public TestBase64(String name)
protected void setUp() throws Exception
{
super.setUp();
base64 = new Base64();
}
/**
@ -45,8 +41,6 @@ protected void setUp() throws Exception
*/
protected void tearDown() throws Exception
{
base64 = null;
super.tearDown();
}
@ -59,8 +53,8 @@ public void testEncodeDecode()
String data = "string to encode";
byte[] expectedReturn = data.getBytes();
byte[] encodedData = base64.encode(data.getBytes());
byte[] actualReturn = base64.decode(encodedData);
byte[] encodedData = Base64.encode(data.getBytes());
byte[] actualReturn = Base64.decode(encodedData);
assertTrue("encode decode failed.", Arrays.equals(
expectedReturn, actualReturn));
}
@ -74,11 +68,11 @@ public void testEncodeDecode1()
String data = "string to encode";
byte[] expectedReturn = data.getBytes();
byte[] encodedData = base64.encode(data.getBytes());
byte[] encodedData = Base64.encode(data.getBytes());
String encodedString = new String(encodedData);
byte[] actualReturn = base64.decode(encodedString);
byte[] actualReturn = Base64.decode(encodedString);
assertTrue("encode decode failed.", Arrays.equals(
expectedReturn, actualReturn));

Loading…
Cancel
Save