diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2013-05-23 18:50:35 +0300 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2013-05-23 18:50:35 +0300 |
commit | b211c26d6c8f51a75d3b64b6092284c3847a3a8a (patch) | |
tree | a51b7d816a27f8db492cf9c44f998e2da8176635 /src/net/java/sip/communicator/util | |
parent | 24e81b82808681c6b5741b14048ef58c4e665e37 (diff) | |
download | jitsi-b211c26d6c8f51a75d3b64b6092284c3847a3a8a.zip jitsi-b211c26d6c8f51a75d3b64b6092284c3847a3a8a.tar.gz jitsi-b211c26d6c8f51a75d3b64b6092284c3847a3a8a.tar.bz2 |
Fixes warnings, removes trailing whitespace, adds @Override annotations.
Diffstat (limited to 'src/net/java/sip/communicator/util')
17 files changed, 69 insertions, 55 deletions
diff --git a/src/net/java/sip/communicator/util/ByteFormat.java b/src/net/java/sip/communicator/util/ByteFormat.java index 14bcd39..c92f069 100644 --- a/src/net/java/sip/communicator/util/ByteFormat.java +++ b/src/net/java/sip/communicator/util/ByteFormat.java @@ -55,6 +55,7 @@ public class ByteFormat * @return A formatted string representing the given bytes in more * human-readable form. */ + @Override public StringBuffer format(Object obj, StringBuffer buf, FieldPosition pos) { if (obj instanceof Long) @@ -69,13 +70,13 @@ public class ByteFormat { DecimalFormat formatter = new DecimalFormat("#,##0.0"); buf.append( - formatter.format((double)numBytes / 1024.0)).append(" K"); + formatter.format(numBytes / 1024.0)).append(" K"); } else if (numBytes < 1024 * 1024 * 1024) { DecimalFormat formatter = new DecimalFormat("#,##0.0"); buf.append( - formatter.format((double)numBytes / (1024.0 * 1024.0))) + formatter.format(numBytes / (1024.0 * 1024.0))) .append(" MB"); } else @@ -83,7 +84,7 @@ public class ByteFormat DecimalFormat formatter = new DecimalFormat("#,##0.0"); buf.append( formatter.format( - (double)numBytes / (1024.0 * 1024.0 * 1024.0))) + numBytes / (1024.0 * 1024.0 * 1024.0))) .append(" GB"); } } @@ -97,6 +98,7 @@ public class ByteFormat * @param pos Position to parse from. * @return returns null in this implementation. */ + @Override public Object parseObject(String source, ParsePosition pos) { return null; diff --git a/src/net/java/sip/communicator/util/Entities.java b/src/net/java/sip/communicator/util/Entities.java index 7efddbe..3170759 100644 --- a/src/net/java/sip/communicator/util/Entities.java +++ b/src/net/java/sip/communicator/util/Entities.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,13 +24,13 @@ import java.util.*; * <p> * Provides HTML and XML entity utilities. * </p> - * + * * @see <a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/">ISO Entities</a> * @see <a href="http://www.w3.org/TR/REC-html32#latin1">HTML 3.2 Character Entities for ISO Latin-1</a> * @see <a href="http://www.w3.org/TR/REC-html40/sgml/entities.html">HTML 4.0 Character entity references</a> * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3">HTML 4.01 Character References</a> * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a> - * + * * @author <a href="mailto:alex@purpletech.com">Alexander Day Chaffee</a> * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a> * @since 2.0 @@ -387,7 +387,7 @@ class Entities { * <p> * Fills the specified entities instance with HTML 40 entities. * </p> - * + * * @param entities * the instance to be filled. */ @@ -402,7 +402,7 @@ class Entities { * <p> * Add an entry to this entity map. * </p> - * + * * @param name * the entity name * @param value @@ -414,7 +414,7 @@ class Entities { * <p> * Returns the name of the entity identified by the specified value. * </p> - * + * * @param value * the value to locate * @return entity name associated with the specified value @@ -425,7 +425,7 @@ class Entities { * <p> * Returns the value of the entity identified by the specified name. * </p> - * + * * @param name * the name to locate * @return entity value associated with the specified name @@ -520,6 +520,7 @@ class Entities { /** * {@inheritDoc} */ + @Override public String name(int value) { if (value < LOOKUP_TABLE_SIZE) { return lookupTable()[value]; @@ -531,7 +532,7 @@ class Entities { * <p> * Returns the lookup table for this entity map. The lookup table is created if it has not been previously. * </p> - * + * * @return the lookup table */ private String[] lookupTable() { @@ -574,7 +575,7 @@ class Entities { /** * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the array should * grow. - * + * * @param growBy * array will be initialized to and will grow by this amount */ @@ -596,7 +597,7 @@ class Entities { /** * Verifies the capacity of the entity array, adjusting the size if necessary. - * + * * @param capacity * size the array should be */ @@ -649,7 +650,7 @@ class Entities { /** * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the underlying array * should grow. - * + * * @param growBy * array will be initialized to and will grow by this amount */ @@ -660,7 +661,7 @@ class Entities { /** * Performs a binary search of the entity array for the specified key. This method is based on code in * {@link java.util.Arrays}. - * + * * @param key * the key to be found * @return the index of the entity array matching the specified key @@ -687,6 +688,7 @@ class Entities { /** * {@inheritDoc} */ + @Override public void add(String name, int value) { ensureCapacity(size + 1); int insertAt = binarySearch(value); @@ -704,6 +706,7 @@ class Entities { /** * {@inheritDoc} */ + @Override public String name(int value) { int index = binarySearch(value); if (index < 0) { @@ -720,7 +723,7 @@ class Entities { * <p> * Adds entities to this entity. * </p> - * + * * @param entityArray * array of entities to be added */ @@ -734,7 +737,7 @@ class Entities { * <p> * Add an entity to this entity. * </p> - * + * * @param name * name of the entity * @param value @@ -748,7 +751,7 @@ class Entities { * <p> * Returns the name of the entity identified by the specified value. * </p> - * + * * @param value * the value to locate * @return entity name associated with the specified value @@ -761,7 +764,7 @@ class Entities { * <p> * Returns the value of the entity identified by the specified name. * </p> - * + * * @param name * the name to locate * @return entity value associated with the specified name @@ -774,12 +777,12 @@ class Entities { * <p> * Escapes the characters in a <code>String</code>. * </p> - * + * * <p> * For example, if you have called addEntity("foo", 0xA1), escape("\u00A1") will return * "&foo;" * </p> - * + * * @param str * The <code>String</code> to escape. * @return A new escaped <code>String</code>. @@ -801,7 +804,7 @@ class Entities { * Escapes the characters in the <code>String</code> passed and writes the result to the <code>Writer</code> * passed. * </p> - * + * * @param writer * The <code>Writer</code> to write the results of the escaping to. Assumed to be a non-null value. * @param str @@ -809,7 +812,7 @@ class Entities { * @throws IOException * when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)} * methods. - * + * * @see #escape(String) * @see Writer */ @@ -838,12 +841,12 @@ class Entities { * <p> * Unescapes the entities in a <code>String</code>. * </p> - * + * * <p> * For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return * "\u00A1" * </p> - * + * * @param str * The <code>String</code> to escape. * @return A new escaped <code>String</code>. @@ -857,7 +860,7 @@ class Entities { try { this.doUnescape(stringWriter, str, firstAmp); } catch (IOException e) { - // This should never happen because ALL the StringWriter methods called by #escape(Writer, String) + // This should never happen because ALL the StringWriter methods called by #escape(Writer, String) // do not throw IOExceptions. throw new RuntimeException(e); } @@ -880,7 +883,7 @@ class Entities { * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the * <code>Writer</code> passed. * </p> - * + * * @param writer * The <code>Writer</code> to write the results to; assumed to be non-null. * @param str @@ -888,7 +891,7 @@ class Entities { * @throws IOException * when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)} * methods. - * + * * @see #escape(String) * @see Writer */ diff --git a/src/net/java/sip/communicator/util/FileUtils.java b/src/net/java/sip/communicator/util/FileUtils.java index 2336c8f..f8ab520 100644 --- a/src/net/java/sip/communicator/util/FileUtils.java +++ b/src/net/java/sip/communicator/util/FileUtils.java @@ -14,7 +14,7 @@ import javax.swing.filechooser.*; /** * Utility class that allows to check if a given file is an image or to obtain * the file thumbnail icon. - * + * * @author Yana Stamcheva */ public class FileUtils @@ -27,7 +27,7 @@ public class FileUtils /** * Returns <code>true</code> if the file given by <tt>fileName</tt> is an * image, <tt>false</tt> - otherwise. - * + * * @param fileName the name of the file to check * @return <code>true</code> if the file is an image, <tt>false</tt> - * otherwise. diff --git a/src/net/java/sip/communicator/util/GenericBuffer.java b/src/net/java/sip/communicator/util/GenericBuffer.java index 9900b46..674e055 100644 --- a/src/net/java/sip/communicator/util/GenericBuffer.java +++ b/src/net/java/sip/communicator/util/GenericBuffer.java @@ -1,6 +1,6 @@ /*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
- *
+ *
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package net.java.sip.communicator.util;
@@ -26,7 +26,7 @@ public class GenericBuffer<T> /**
* Sole constructor.
- *
+ *
* @param bufferSize The buffer size. Adding data to a full buffer will
* cause the oldest data present in the buffer to be overwritten;
*/
@@ -41,7 +41,7 @@ public class GenericBuffer<T> /**
* Adds a value to the buffer. If the buffer is full, the oldest value in
* the buffer will be overwritten by this new value.
- *
+ *
* @param value The value to add. Can't be null.
* @param context The context for which this value is valid. This basically
* represents the current value of all the variables which
@@ -87,7 +87,7 @@ public class GenericBuffer<T> /**
* Retrieves the value in the buffer corresponding to the context if it
* exists.
- *
+ *
* @param context The context of the searched value. The context represents
* all the variables values for which this value is correct.
* @return The bufferized value with the searched context if it exists or
diff --git a/src/net/java/sip/communicator/util/GuiUtils.java b/src/net/java/sip/communicator/util/GuiUtils.java index 3217aba..b7b6ebd 100644 --- a/src/net/java/sip/communicator/util/GuiUtils.java +++ b/src/net/java/sip/communicator/util/GuiUtils.java @@ -321,11 +321,11 @@ public class GuiUtils GuiUtils.formatTime(c1.get(Calendar.SECOND), timeStrBuf); return timeStrBuf.toString(); } - + /** * Formats the time period duration for the given start date and end date. * The result format is the following: - * [Hour]:[Minute]:[Second]. For example: 12:25:30. + * [Hour]:[Minute]:[Second]. For example: 12:25:30. * @param startDate the start date * @param endDate the end date * @return the formatted hour string @@ -464,7 +464,7 @@ public class GuiUtils } return resultId; } - + /** * Escapes special HTML characters such as <, >, & and " in * the specified message. diff --git a/src/net/java/sip/communicator/util/Html2Text.java b/src/net/java/sip/communicator/util/Html2Text.java index 2848f4d..e0d0dbc 100644 --- a/src/net/java/sip/communicator/util/Html2Text.java +++ b/src/net/java/sip/communicator/util/Html2Text.java @@ -1,6 +1,6 @@ /* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. - * + * * Distributable under LGPL license. * See terms of license at gnu.org. */ @@ -14,7 +14,7 @@ import javax.swing.text.html.parser.*; /** * A utility class that allows to extract the text content of an HTML page * stripped from all formatting tags. - * + * * @author Emil Ivov <emcho at sip-communicator.org> * @author Yana Stamcheva * @author Lubomir Marinov @@ -35,10 +35,10 @@ public class Html2Text private static HTMLParserCallback parser; /** - * A utility method that allows to extract the text content of an HTML page - * stripped from all formatting tags. Method is synchronized to avoid + * A utility method that allows to extract the text content of an HTML page + * stripped from all formatting tags. Method is synchronized to avoid * concurrent access to the underlying <tt>HTMLEditorKit</tt>. - * + * * @param html the HTML string that we will extract the text from. * @return the text content of the <tt>html</tt> parameter. */ @@ -85,7 +85,7 @@ public class Html2Text /** * Parses the text contained in the given reader. - * + * * @param in the reader to parse. * @return the parsed text * @throws IOException thrown if we fail to parse the reader. diff --git a/src/net/java/sip/communicator/util/NetworkUtils.java b/src/net/java/sip/communicator/util/NetworkUtils.java index 5e88589..691df87 100644 --- a/src/net/java/sip/communicator/util/NetworkUtils.java +++ b/src/net/java/sip/communicator/util/NetworkUtils.java @@ -909,7 +909,7 @@ public class NetworkUtils /** * Returns array of hosts from the A and AAAA records of the specified * domain. The records are ordered against the IPv4/IPv6 protocol priority - * + * * @param domain the name of the domain we'd like to resolve. * @param port the port number of the returned <tt>InetSocketAddress</tt> * @return an array of InetSocketAddress containing records returned by the @@ -1080,7 +1080,7 @@ public class NetworkUtils * @return an array of InetSocketAddress containing records returned by the * DNS server - address and port . * @throws ParseException if <tt>domain</tt> is not a valid domain name. - * @throws DnssecException + * @throws DnssecException */ public static InetSocketAddress getAAAARecord(String domain, int port) throws ParseException, DnssecException diff --git a/src/net/java/sip/communicator/util/OrderedProperties.java b/src/net/java/sip/communicator/util/OrderedProperties.java index a0010a9..d01d8ad 100644 --- a/src/net/java/sip/communicator/util/OrderedProperties.java +++ b/src/net/java/sip/communicator/util/OrderedProperties.java @@ -58,6 +58,7 @@ public class OrderedProperties * @param key key * @return previous value pointed by key if any, null otherwise */ + @Override public Object remove(Object key) { return linkedMap.remove(key); @@ -110,6 +111,7 @@ public class OrderedProperties * * @return number of elements */ + @Override public int size() { return linkedMap.size(); diff --git a/src/net/java/sip/communicator/util/SRVRecord.java b/src/net/java/sip/communicator/util/SRVRecord.java index 302ce94..7423653 100644 --- a/src/net/java/sip/communicator/util/SRVRecord.java +++ b/src/net/java/sip/communicator/util/SRVRecord.java @@ -91,7 +91,7 @@ public class SRVRecord /** * Returns the toString of the org.xbill.DNS.SRVRecord that was passed to * the constructor. - * + * * @return the toString of the org.xbill.DNS.SRVRecord that was passed to * the constructor. */ diff --git a/src/net/java/sip/communicator/util/ScLogFormatter.java b/src/net/java/sip/communicator/util/ScLogFormatter.java index a201bfc..900eed5 100644 --- a/src/net/java/sip/communicator/util/ScLogFormatter.java +++ b/src/net/java/sip/communicator/util/ScLogFormatter.java @@ -33,6 +33,7 @@ public class ScLogFormatter * @param record the log record to be formatted. * @return a formatted log record */ + @Override public synchronized String format(LogRecord record) { StringBuffer sb = new StringBuffer(); diff --git a/src/net/java/sip/communicator/util/Sha1Crypto.java b/src/net/java/sip/communicator/util/Sha1Crypto.java index 710ad53..140847b 100644 --- a/src/net/java/sip/communicator/util/Sha1Crypto.java +++ b/src/net/java/sip/communicator/util/Sha1Crypto.java @@ -13,13 +13,13 @@ public class Sha1Crypto { /** * Encodes the given text with the SHA-1 algorithm. - * + * * @param text the text to encode * @return the encoded text * @throws NoSuchAlgorithmException * @throws UnsupportedEncodingException */ - public static String encode(String text) + public static String encode(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException { @@ -34,13 +34,13 @@ public class Sha1Crypto /** * Encodes the given text with the SHA-1 algorithm. - * + * * @param byteArray the byte array to encode * @return the encoded text * @throws NoSuchAlgorithmException * @throws UnsupportedEncodingException */ - public static String encode(byte[] byteArray) + public static String encode(byte[] byteArray) throws NoSuchAlgorithmException, UnsupportedEncodingException { @@ -55,7 +55,7 @@ public class Sha1Crypto /** * Converts the given byte data into Hex string. - * + * * @param data the byte array to convert * @return the Hex string representation of the given byte array */ diff --git a/src/net/java/sip/communicator/util/UtilActivator.java b/src/net/java/sip/communicator/util/UtilActivator.java index ed31fcd..449b171 100644 --- a/src/net/java/sip/communicator/util/UtilActivator.java +++ b/src/net/java/sip/communicator/util/UtilActivator.java @@ -215,7 +215,7 @@ public class UtilActivator */ public static MediaConfigurationService getMediaConfiguration() { - return ServiceUtils.getService(bundleContext, + return ServiceUtils.getService(bundleContext, MediaConfigurationService.class); } diff --git a/src/net/java/sip/communicator/util/account/AccountStatusUtils.java b/src/net/java/sip/communicator/util/account/AccountStatusUtils.java index ee42942..bc32980 100644 --- a/src/net/java/sip/communicator/util/account/AccountStatusUtils.java +++ b/src/net/java/sip/communicator/util/account/AccountStatusUtils.java @@ -77,7 +77,7 @@ public class AccountStatusUtils /**
* Returns the last contact status saved in the configuration.
- *
+ *
* @param protocolProvider the protocol provider to which the status
* corresponds
* @return the last contact status saved in the configuration.
diff --git a/src/net/java/sip/communicator/util/account/LoginManager.java b/src/net/java/sip/communicator/util/account/LoginManager.java index 5e237cc..1afdc0e 100644 --- a/src/net/java/sip/communicator/util/account/LoginManager.java +++ b/src/net/java/sip/communicator/util/account/LoginManager.java @@ -423,6 +423,7 @@ public class LoginManager * Registers the contained protocol provider and process all possible
* errors that may occur during the registration process.
*/
+ @Override
public void run()
{
try
@@ -546,6 +547,7 @@ public class LoginManager * Unregisters the contained protocol provider and process all possible
* errors that may occur during the un-registration process.
*/
+ @Override
public void run()
{
try
diff --git a/src/net/java/sip/communicator/util/launchutils/AEGetURLEventHandler.java b/src/net/java/sip/communicator/util/launchutils/AEGetURLEventHandler.java index db4d2e8..97aeec7 100644 --- a/src/net/java/sip/communicator/util/launchutils/AEGetURLEventHandler.java +++ b/src/net/java/sip/communicator/util/launchutils/AEGetURLEventHandler.java @@ -42,6 +42,7 @@ public class AEGetURLEventHandler { new Thread() { + @Override public void run() { AEGetURLEventHandler.this.launchArgHandler. diff --git a/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java b/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java index df18082..e6d8b81 100644 --- a/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java +++ b/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java @@ -671,6 +671,7 @@ public class SipCommunicatorLock extends Thread * Simply collects everything that we read from the InputStream that * this <tt>InterInstanceCommunicationClient</tt> was created with. */ + @Override public void run() { try @@ -727,6 +728,7 @@ public class SipCommunicatorLock extends Thread this.lockSocket = serverSocket; } + @Override public void run() { try @@ -774,6 +776,7 @@ public class SipCommunicatorLock extends Thread /** * Starts reading messages arriving through the connection socket. */ + @Override public void run() { InputStream is; diff --git a/src/net/java/sip/communicator/util/wizard/EncodingsRegistrationUtil.java b/src/net/java/sip/communicator/util/wizard/EncodingsRegistrationUtil.java index aecf94a..dbacc9f 100644 --- a/src/net/java/sip/communicator/util/wizard/EncodingsRegistrationUtil.java +++ b/src/net/java/sip/communicator/util/wizard/EncodingsRegistrationUtil.java @@ -15,7 +15,7 @@ import org.jitsi.service.neomedia.codec.*; /** * An interface to get/set settings in the encodings panel. - * + * * @author Boris Grozev * @author Pawel Domas */ |