Skip to content

Commit

Permalink
Merge pull request #185 from DevFactory/release/diamond-operator-shou…
Browse files Browse the repository at this point in the history
…ld-be-used-fix-1

Code quality fix - The diamond operator ("<>") should be used.
  • Loading branch information
Simon authored Apr 10, 2018
2 parents 89e0382 + 2d9a17f commit e71b49c
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 @@ -59,7 +59,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 @@ -71,7 +71,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 @@ -105,7 +105,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 @@ -117,7 +117,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 @@ -36,7 +36,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 @@ -582,7 +582,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 @@ -86,12 +86,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 @@ -621,7 +621,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 @@ -62,8 +62,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 e71b49c

Please sign in to comment.