Skip to content

Commit

Permalink
Fixing squid:S2293 - The diamond operator ("<>") should be used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Faisal Hameed committed Mar 17, 2016
1 parent 94189f4 commit 2d9a17f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/net/majorkernelpanic/streaming/hw/CodecManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Codec(String name, Integer[] formats) {
public synchronized static Codec[] findEncodersForMimeType(String mimeType) {
if (sEncoders != null) return sEncoders;

ArrayList<Codec> encoders = new ArrayList<Codec>();
ArrayList<Codec> encoders = new ArrayList<>();

// We loop through the encoders, apparently this can take up to a sec (testes on a GS3)
for(int j = MediaCodecList.getCodecCount() - 1; j >= 0; j--){
Expand All @@ -74,7 +74,7 @@ public synchronized static Codec[] findEncodersForMimeType(String mimeType) {
if (types[i].equalsIgnoreCase(mimeType)) {
try {
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
Set<Integer> formats = new HashSet<Integer>();
Set<Integer> formats = new HashSet<>();

// And through the color formats supported
for (int k = 0; k < capabilities.colorFormats.length; k++) {
Expand Down Expand Up @@ -108,7 +108,7 @@ public synchronized static Codec[] findEncodersForMimeType(String mimeType) {
@SuppressLint("NewApi")
public synchronized static Codec[] findDecodersForMimeType(String mimeType) {
if (sDecoders != null) return sDecoders;
ArrayList<Codec> decoders = new ArrayList<Codec>();
ArrayList<Codec> decoders = new ArrayList<>();

// We loop through the decoders, apparently this can take up to a sec (testes on a GS3)
for(int j = MediaCodecList.getCodecCount() - 1; j >= 0; j--){
Expand All @@ -120,7 +120,7 @@ public synchronized static Codec[] findDecodersForMimeType(String mimeType) {
if (types[i].equalsIgnoreCase(mimeType)) {
try {
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
Set<Integer> formats = new HashSet<Integer>();
Set<Integer> formats = new HashSet<>();

// And through the color formats supported
for (int k = 0; k < capabilities.colorFormats.length; k++) {
Expand Down
2 changes: 1 addition & 1 deletion src/net/majorkernelpanic/streaming/mp4/MP4Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MP4Parser {

private static final String TAG = "MP4Parser";

private HashMap<String, Long> mBoxes = new HashMap<String, Long>();
private HashMap<String, Long> mBoxes = new HashMap<>();
private final RandomAccessFile mFile;
private long mPos = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/net/majorkernelpanic/streaming/rtsp/RtspClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static class Response {


public int status;
public HashMap<String,String> headers = new HashMap<String,String>();
public HashMap<String,String> headers = new HashMap<>();

/** Parse the method, URI & headers of a RTSP request */
public static Response parseResponse(BufferedReader input) throws IOException, IllegalStateException, SocketException {
Expand Down
6 changes: 3 additions & 3 deletions src/net/majorkernelpanic/streaming/rtsp/RtspServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public class RtspServer extends Service {
protected SharedPreferences mSharedPreferences;
protected boolean mEnabled = true;
protected int mPort = DEFAULT_RTSP_PORT;
protected WeakHashMap<Session,Object> mSessions = new WeakHashMap<Session,Object>(2);
protected WeakHashMap<Session,Object> mSessions = new WeakHashMap<>(2);

private RequestListener mListenerThread;
private final IBinder mBinder = new LocalBinder();
private boolean mRestart = false;
private final LinkedList<CallbackListener> mListeners = new LinkedList<CallbackListener>();
private final LinkedList<CallbackListener> mListeners = new LinkedList<>();

/** Credentials for Basic Auth */
private String mUsername;
Expand Down Expand Up @@ -624,7 +624,7 @@ static class Request {

public String method;
public String uri;
public HashMap<String,String> headers = new HashMap<String,String>();
public HashMap<String,String> headers = new HashMap<>();

/** Parse the method, uri & headers of a RTSP request */
public static Request parseRequest(BufferedReader input) throws IOException, IllegalStateException, SocketException {
Expand Down
4 changes: 2 additions & 2 deletions src/net/majorkernelpanic/streaming/video/CodecManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ static class Codecs {
*/
static class Selector {

private static HashMap<String,SparseArray<ArrayList<String>>> sHardwareCodecs = new HashMap<String, SparseArray<ArrayList<String>>>();
private static HashMap<String,SparseArray<ArrayList<String>>> sSoftwareCodecs = new HashMap<String, SparseArray<ArrayList<String>>>();
private static HashMap<String,SparseArray<ArrayList<String>>> sHardwareCodecs = new HashMap<>();
private static HashMap<String,SparseArray<ArrayList<String>>> sSoftwareCodecs = new HashMap<>();

/**
* Determines the most appropriate encoder to compress the video from the Camera
Expand Down

0 comments on commit 2d9a17f

Please sign in to comment.