1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Xlint all the things

and fix all warnings.
This commit is contained in:
Florian Schmaus 2015-03-23 09:27:15 +01:00
parent 7c5428ab0e
commit f546d28ad8
50 changed files with 142 additions and 122 deletions

View file

@ -90,10 +90,9 @@ public class JMFInit extends Frame implements Runnable {
tempDir = args[0];
message("Setting cache directory to " + tempDir);
Registry r = new Registry();
try {
r.set("secure.cacheDir", tempDir);
r.commit();
Registry.set("secure.cacheDir", tempDir);
Registry.commit();
message("Updated registry");
}
@ -207,6 +206,7 @@ public class JMFInit extends Frame implements Runnable {
PlugInManager.addPlugIn(dar, inputFormats, new Format[0],
plType);
// Move it to the top of the list
@SuppressWarnings("unchecked")
Vector<String> rendList = PlugInManager.getPlugInList(null, null,
plType);
int listSize = rendList.size();
@ -244,6 +244,7 @@ public class JMFInit extends Frame implements Runnable {
if (rend instanceof ExclusiveUse
&& !((ExclusiveUse) rend).isExclusive()) {
// sol8+, DAR supports mixing
@SuppressWarnings("unchecked")
Vector<String> rendList = PlugInManager.getPlugInList(null, null,
plType);
int listSize = rendList.size();
@ -251,7 +252,7 @@ public class JMFInit extends Frame implements Runnable {
String rname = null;
for (int i = 0; i < listSize; i++) {
rname = (String) (rendList.elementAt(i));
rname = rendList.elementAt(i);
if (rname.equals(dar)) { // DAR is in the registry
found = true;
rendList.removeElementAt(i);

View file

@ -17,6 +17,8 @@
package org.jivesoftware.smackx.jingleold.mediaimpl.sshare.api;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;
@ -71,13 +73,13 @@ public class OctTreeQuantizer implements Quantizer {
private int reduceColors;
private int maximumColors;
private int colors = 0;
private Vector<OctTreeNode>[] colorList;
private List<Vector<OctTreeNode>> colorList;
public OctTreeQuantizer() {
public OctTreeQuantizer() {
setup(256);
colorList = new Vector[MAX_LEVEL+1];
colorList = new ArrayList<>(MAX_LEVEL+1);
for (int i = 0; i < MAX_LEVEL+1; i++)
colorList[i] = new Vector<OctTreeNode>();
colorList.add(i, new Vector<OctTreeNode>());
root = new OctTreeNode();
}
@ -171,7 +173,7 @@ public class OctTreeQuantizer implements Quantizer {
node.leaf[index] = child;
node.isLeaf = false;
nodes++;
colorList[level].addElement(child);
colorList.get(level).addElement(child);
if (level == MAX_LEVEL) {
child.isLeaf = true;
@ -199,7 +201,7 @@ public class OctTreeQuantizer implements Quantizer {
private void reduceTree(int numColors) {
for (int level = MAX_LEVEL-1; level >= 0; level--) {
Vector<OctTreeNode> v = colorList[level];
Vector<OctTreeNode> v = colorList.get(level);
if (v != null && v.size() > 0) {
for (int j = 0; j < v.size(); j++) {
OctTreeNode node = v.elementAt(j);
@ -217,7 +219,7 @@ public class OctTreeQuantizer implements Quantizer {
node.children--;
colors--;
nodes--;
colorList[level+1].removeElement(child);
colorList.get(level+1).removeElement(child);
}
}
node.isLeaf = true;

View file

@ -392,6 +392,7 @@ public class RTPBridge extends IQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
@SuppressWarnings("deprecation")
public static RTPBridge getRTPBridge(XMPPConnection connection, String sessionID) throws NotConnectedException, InterruptedException {
if (!connection.isConnected()) {
@ -459,6 +460,7 @@ public class RTPBridge extends IQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
@SuppressWarnings("deprecation")
public static RTPBridge relaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) throws NotConnectedException, InterruptedException {
if (!connection.isConnected()) {
@ -495,6 +497,7 @@ public class RTPBridge extends IQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
@SuppressWarnings("deprecation")
public static String getPublicIP(XMPPConnection xmppConnection) throws NotConnectedException, InterruptedException {
if (!xmppConnection.isConnected()) {

View file

@ -175,6 +175,7 @@ public class STUN extends SimpleIQ {
* @throws NotConnectedException
* @throws InterruptedException
*/
@SuppressWarnings("deprecation")
public static STUN getSTUNServer(XMPPConnection connection) throws NotConnectedException, InterruptedException {
if (!connection.isConnected()) {

View file

@ -133,7 +133,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param bestLocalCandidate the acceptedLocalCandidate to set
*/
private void setAcceptedLocalCandidate(TransportCandidate bestLocalCandidate) throws XMPPException {
private void setAcceptedLocalCandidate(TransportCandidate bestLocalCandidate) {
for (int i = 0; i < resolver.getCandidateCount(); i++) {
//TODO FIX The EQUAL Sentence
if (resolver.getCandidate(i).getIp().equals(bestLocalCandidate.getIp())
@ -708,7 +708,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
* @param jingleTransport
* @return the iq
*/
private IQ receiveTransportInfoAction(Jingle jingle) throws XMPPException {
private IQ receiveTransportInfoAction(Jingle jingle) {
IQ response = null;
// Parse the Jingle and get any proposed transport candidates
@ -755,7 +755,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
LOGGER.fine("Remote acccepted candidate addr: " + cand.getIp());
}
TransportCandidate cand = (TransportCandidate) accepted.get(0);
TransportCandidate cand = accepted.get(0);
setAcceptedLocalCandidate(cand);
if (isEstablished()) {
@ -770,7 +770,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
* @param jingle
* @return the iq
*/
private IQ receiveSessionAcceptAction(Jingle jingle) {
private static IQ receiveSessionAcceptAction(Jingle jingle) {
IQ response = null;
LOGGER.fine("Transport stabilished");
@ -855,7 +855,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
ArrayList<TransportCandidate> cands = getValidRemoteCandidatesList();
if (!cands.isEmpty()) {
LOGGER.fine("RAW CAND");
return (TransportCandidate) cands.get(0);
return cands.get(0);
} else {
LOGGER.fine("No Remote Candidate");
return null;

View file

@ -310,7 +310,7 @@ public abstract class TransportResolver {
if (cands.size() > 0) {
Collections.sort(cands);
// Return the last candidate
result = (TransportCandidate) cands.get(cands.size() - 1);
result = cands.get(cands.size() - 1);
LOGGER.fine("Result: " + result.getIp());
}
@ -352,7 +352,7 @@ public abstract class TransportResolver {
TransportCandidate cand;
synchronized (candidates) {
cand = (TransportCandidate) candidates.get(i);
cand = candidates.get(i);
}
return cand;
}

View file

@ -125,7 +125,7 @@ public abstract class JingleDescription implements ExtensionElement {
Iterator<PayloadType> jinglePtsIter = getPayloadTypes();
while (jinglePtsIter.hasNext()) {
PayloadType jpt = (PayloadType) jinglePtsIter.next();
PayloadType jpt = jinglePtsIter.next();
if (jpt instanceof PayloadType.Audio) {
PayloadType.Audio jpta = (PayloadType.Audio) jpt;
result.add(jpta);

View file

@ -63,7 +63,7 @@ public class JingleProvider extends IQProvider<Jingle> {
JingleDescriptionProvider jdpAudio = new JingleDescriptionProvider.Audio();
JingleTransportProvider jtpRawUdp = new JingleTransportProvider.RawUdp();
JingleTransportProvider jtpIce = new JingleTransportProvider.Ice();
ExtensionElementProvider jmipAudio = new JingleContentInfoProvider.Audio();
ExtensionElementProvider<?> jmipAudio = new JingleContentInfoProvider.Audio();
int eventType;
String elementName;
@ -93,19 +93,19 @@ public class JingleProvider extends IQProvider<Jingle> {
if (elementName.equals(JingleContent.NODENAME)) {
// Add a new <content> element to the jingle
currentContent = (JingleContent) jcp.parse(parser);
currentContent = jcp.parse(parser);
jingle.addContent(currentContent);
} else if (elementName.equals(JingleDescription.NODENAME) && namespace.equals(JingleDescription.Audio.NAMESPACE)) {
// Set the <description> element of the <content>
currentContent.setDescription((JingleDescription) jdpAudio.parse(parser));
currentContent.setDescription(jdpAudio.parse(parser));
} else if (elementName.equals(JingleTransport.NODENAME)) {
// Add all of the <transport> elements to the <content> of the jingle
// Parse the possible transport namespaces
if (namespace.equals(JingleTransport.RawUdp.NAMESPACE)) {
currentContent.addJingleTransport((JingleTransport) jtpRawUdp.parse(parser));
currentContent.addJingleTransport(jtpRawUdp.parse(parser));
} else if (namespace.equals(JingleTransport.Ice.NAMESPACE)) {
currentContent.addJingleTransport((JingleTransport) jtpIce.parse(parser));
currentContent.addJingleTransport(jtpIce.parse(parser));
} else {
throw new SmackException("Unknown transport namespace \"" + namespace + "\" in Jingle packet.");
}