1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-08 14:11:07 +01:00

Enable more 'checkstyle' checks

AvoidStarImport
IllegalImport
RedundantImport
UpperEll
ArrayTypeStyle
GenericWhitespace
EmptyStatement
PackageDelcaration
This commit is contained in:
Florian Schmaus 2014-08-15 23:16:18 +02:00
parent 522d0f30ff
commit 7277eb553a
92 changed files with 465 additions and 253 deletions

View file

@ -78,7 +78,7 @@ public class AudioChannel {
private Format format;
private Processor processor = null;
private RTPManager rtpMgrs[];
private RTPManager[] rtpMgrs;
private DataSource dataOutput = null;
private AudioReceiver audioReceiver;
@ -230,7 +230,7 @@ public class AudioChannel {
ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
processor.setContentDescriptor(cd);
Format supported[];
Format[] supported;
Format chosen = null;
boolean atLeastOneTrack = false;
@ -265,7 +265,7 @@ public class AudioChannel {
}
if (tracks[i].getFormat().getEncoding().equals(AudioFormat.ULAW_RTP)) {
Codec codec[] = new Codec[3];
Codec[] codec = new Codec[3];
codec[0] = new com.ibm.media.codec.audio.rc.RCModule();
codec[1] = new com.ibm.media.codec.audio.ulaw.JavaEncoder();
@ -339,7 +339,7 @@ public class AudioChannel {
// Cheated. Should have checked the type.
PushBufferDataSource pbds = (PushBufferDataSource) dataOutput;
PushBufferStream pbss[] = pbds.getStreams();
PushBufferStream[] pbss = pbds.getStreams();
rtpMgrs = new RTPManager[pbss.length];
SessionAddress localAddr, destAddr;
@ -498,7 +498,7 @@ public class AudioChannel {
}
}
public static void main(String args[]) {
public static void main(String[] args) {
InetAddress localhost;
try {

View file

@ -16,7 +16,8 @@
*/
package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
import java.awt.*;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;

View file

@ -16,7 +16,8 @@
*/
package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
import java.awt.*;
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -36,7 +37,7 @@ public class ImageReceiver extends Canvas {
private static final long serialVersionUID = -7000112305305269025L;
private boolean on = true;
private DatagramSocket socket;
private BufferedImage tiles[][];
private BufferedImage[][] tiles;
private static final int tileWidth = ImageTransmitter.tileWidth;
private InetAddress localHost;
private InetAddress remoteHost;
@ -58,7 +59,7 @@ public class ImageReceiver extends Canvas {
new Thread(new Runnable() {
public void run() {
byte buf[] = new byte[1024];
byte[] buf = new byte[1024];
DatagramPacket p = new DatagramPacket(buf, 1024);
try {
while (on) {
@ -87,7 +88,7 @@ public class ImageReceiver extends Canvas {
new Thread(new Runnable() {
public void run() {
byte buf[] = new byte[1024];
byte[] buf = new byte[1024];
DatagramPacket p = new DatagramPacket(buf, 1024);
try {
while (on) {

View file

@ -49,7 +49,7 @@ public class ImageTransmitter implements Runnable {
private boolean transmit = false;
private DatagramSocket socket;
private Rectangle area;
private int tiles[][][];
private int[][][] tiles;
private int maxI;
private int maxJ;
private ImageEncoder encoder;
@ -83,7 +83,7 @@ public class ImageTransmitter implements Runnable {
}
public void start() {
byte buf[] = new byte[1024];
byte[] buf = new byte[1024];
final DatagramPacket p = new DatagramPacket(buf, 1024);
int keyframe = 0;
@ -108,7 +108,7 @@ public class ImageTransmitter implements Runnable {
final BufferedImage bufferedImage = capture.getSubimage(i * tileWidth, j * tileWidth, tileWidth, tileWidth);
int pixels[] = new int[tileWidth * tileWidth];
int[] pixels = new int[tileWidth * tileWidth];
PixelGrabber pg = new PixelGrabber(bufferedImage, 0, 0, tileWidth, tileWidth, pixels, 0, tileWidth);

View file

@ -41,7 +41,7 @@ public class OctTreeQuantizer implements Quantizer {
int children;
int level;
OctTreeNode parent;
OctTreeNode leaf[] = new OctTreeNode[8];
OctTreeNode[] leaf = new OctTreeNode[8];
boolean isLeaf;
int count;
int totalRed;

View file

@ -16,9 +16,10 @@
*/
package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
import java.awt.*;
import java.awt.Color;
import java.util.Random;
/**
* Some more useful math functions for image processing.
* These are becoming obsolete as we move to Java2D. Use MiscComposite instead.
@ -81,8 +82,8 @@ public class PixelUtils {
return Math.abs(r1-r2) <= tolerance && Math.abs(g1-g2) <= tolerance && Math.abs(b1-b2) <= tolerance;
}
private final static float hsb1[] = new float[3];//FIXME-not thread safe
private final static float hsb2[] = new float[3];//FIXME-not thread safe
private final static float[] hsb1 = new float[3];//FIXME-not thread safe
private final static float[] hsb2 = new float[3];//FIXME-not thread safe
// Return rgb1 painted onto rgb2
public static int combinePixels(int rgb1, int rgb2, int op) {

View file

@ -16,7 +16,7 @@
*/
package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
import java.awt.*;
import java.awt.Rectangle;
/**
* A filter which quantizes an image to a set number of colors - useful for producing

View file

@ -16,7 +16,7 @@
*/
package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api;
import java.awt.*;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.WritableRaster;

View file

@ -16,14 +16,15 @@
*/
package org.jivesoftware.smackx.jingle.mediaimpl.test;
import java.util.ArrayList;
import java.util.List;
import org.jivesoftware.smackx.jingle.JingleSession;
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
import org.jivesoftware.smackx.jingle.media.PayloadType;
import org.jivesoftware.smackx.jingle.nat.JingleTransportManager;
import org.jivesoftware.smackx.jingle.nat.TransportCandidate;
import org.jivesoftware.smackx.jingle.JingleSession;
import java.util.*;
/**
* Implements a MediaManager for test purposes.

View file

@ -69,7 +69,7 @@ public class HttpServer {
}
public static void main(String args[]) {
public static void main(String[] args) {
HttpServer httpServer = new HttpServer(Integer.parseInt(args[0]));
}

View file

@ -72,7 +72,7 @@ public class TcpUdpBridgeClient {
while (true) {
byte b[] = new byte[500];
byte[] b = new byte[500];
DatagramPacket p = new DatagramPacket(b, 500);
localUdpSocket.receive(p);
@ -104,7 +104,7 @@ public class TcpUdpBridgeClient {
process.start();
while (true) {
byte b[] = new byte[500];
byte[] b = new byte[500];
int s = in.read(b);
//if (s == -1) continue;

View file

@ -74,7 +74,7 @@ public class TcpUdpBridgeServer {
while (true) {
byte b[] = new byte[500];
byte[] b = new byte[500];
DatagramPacket p = new DatagramPacket(b, 500);
localUdpSocket.receive(p);
@ -106,7 +106,7 @@ public class TcpUdpBridgeServer {
InetAddress remoteHost = InetAddress.getByName(remoteUdpHost);
while (true) {
byte b[] = new byte[500];
byte[] b = new byte[500];
int s = in.read(b);
//if (s == -1) continue;

View file

@ -611,8 +611,8 @@ public abstract class TransportCandidate {
String localUser = null;
String remoteUser = null;
String id = null;
byte send[] = null;
byte receive[] = null;
byte[] send = null;
byte[] receive = null;
DatagramPacket sendPacket = null;
List<DatagramListener> listeners = new ArrayList<DatagramListener>();
List<ResultListener> resultListeners = new ArrayList<ResultListener>();
@ -677,9 +677,9 @@ public abstract class TransportCandidate {
long delay = 100 / replyTries;
String str[] = new String(packet.getData(), "UTF-8").split(";");
String[] str = new String(packet.getData(), "UTF-8").split(";");
String pass = str[0];
String address[] = str[1].split(":");
String[] address = str[1].split(":");
String ip = address[0];
String port = address[1];
@ -750,9 +750,9 @@ public abstract class TransportCandidate {
try {
LOGGER.fine("ECHO Received to: " + candidate.getIp() + ":" + candidate.getPort() + " data: " + new String(datagramPacket.getData(), "UTF-8"));
String str[] = new String(datagramPacket.getData(), "UTF-8").split(";");
String[] str = new String(datagramPacket.getData(), "UTF-8").split(";");
String pass = str[0];
String addr[] = str[1].split(":");
String[] addr = str[1].split(":");
String ip = addr[0];
String pt = addr[1];

View file

@ -21,7 +21,11 @@ import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smackx.jingle.JingleActionEnum;
import org.jivesoftware.smackx.jingle.packet.*;
import org.jivesoftware.smackx.jingle.packet.Jingle;
import org.jivesoftware.smackx.jingle.packet.JingleContent;
import org.jivesoftware.smackx.jingle.packet.JingleContentInfo;
import org.jivesoftware.smackx.jingle.packet.JingleDescription;
import org.jivesoftware.smackx.jingle.packet.JingleTransport;
import org.xmlpull.v1.XmlPullParser;
/**