From e0873742f2baca6192130947d67c90b5bc5c3105 Mon Sep 17 00:00:00 2001 From: ayman abdelghany Date: Fri, 20 May 2016 14:51:37 +0200 Subject: [PATCH] The operator ("<>") should be used. --- .../twofortyfouram/locale/PackageUtilities.java | 2 +- .../firmatabluetooth/ArduinoFirmata.java | 16 ++++++++-------- .../firmatabluetooth/BluetoothService.java | 2 +- .../com/integreight/firmatabluetooth/Jodem.java | 2 +- .../firmatabluetooth/ShieldFrame.java | 4 ++-- .../onesheeld/OneSheeldApplication.java | 6 +++--- .../adapters/MediaAudioFilesListAdapter.java | 4 ++-- .../onesheeld/adapters/MusicPlayListAdapter.java | 4 ++-- .../adapters/SelectedShieldsListAdapter.java | 2 +- .../onesheeld/adapters/ShieldsListAdapter.java | 2 +- .../integreight/onesheeld/enums/ArduinoPin.java | 2 +- .../integreight/onesheeld/enums/UIShield.java | 4 ++-- .../integreight/onesheeld/model/ApiObjects.java | 2 +- .../popup/ArduinoConnectivityPopup.java | 4 ++-- .../onesheeld/popup/ValidationPopup.java | 4 ++-- .../onesheeld/shields/ControllerParent.java | 6 +++--- .../shields/controller/MusicShield.java | 2 +- .../onesheeld/shields/controller/NfcShield.java | 6 +++--- .../shields/controller/SevenSegmentShield.java | 2 +- .../shields/controller/TerminalShield.java | 4 ++-- .../shields/controller/TextToSpeechShield.java | 2 +- .../shields/controller/TwitterShield.java | 4 ++-- .../shields/controller/utils/GlcdView.java | 2 +- .../controller/utils/glcd/RadioGroup.java | 2 +- .../shields/fragments/TerminalFragment.java | 6 +++--- .../sub/MusicShieldSettings_AddFromMedia.java | 2 +- .../onesheeld/utils/ConnectingPinsView.java | 6 +++--- .../utils/customviews/ComboSeekBar.java | 2 +- .../utils/customviews/LockPatternViewEx.java | 2 +- .../utils/customviews/MultiTouchContainer.java | 2 +- .../customviews/MutitouchKeysContainer.java | 4 ++-- .../utils/customviews/PinsColumnContainer.java | 8 ++++---- .../customviews/PluginPinsColumnContainer.java | 8 ++++---- .../onesheeld/utils/customviews/utils/Lists.java | 4 ++-- .../onesheeld/utils/database/MusicPlaylist.java | 2 +- .../viewpagerindicator/TitlePageIndicator.java | 2 +- .../xml/PullToRefreshConfigXmlParser.java | 8 ++++---- .../configuration/xml/XmlPullNode.java | 2 +- .../library/LoadingLayoutProxy.java | 2 +- .../library/extras/SoundPullEventListener.java | 2 +- 40 files changed, 76 insertions(+), 76 deletions(-) diff --git a/localeapi/src/main/java/com/twofortyfouram/locale/PackageUtilities.java b/localeapi/src/main/java/com/twofortyfouram/locale/PackageUtilities.java index a4b623ce4..566c3e89e 100644 --- a/localeapi/src/main/java/com/twofortyfouram/locale/PackageUtilities.java +++ b/localeapi/src/main/java/com/twofortyfouram/locale/PackageUtilities.java @@ -51,7 +51,7 @@ public final class PackageUtilities */ private static Set constructPackageSet() { - final HashSet packages = new HashSet(); + final HashSet packages = new HashSet<>(); packages.add(Constants.LOCALE_PACKAGE); diff --git a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ArduinoFirmata.java b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ArduinoFirmata.java index 6d0602223..223c5a071 100644 --- a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ArduinoFirmata.java +++ b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ArduinoFirmata.java @@ -143,14 +143,14 @@ public void run() { private boolean isInACallback; public ArduinoFirmata(Context context) { - uartBuffer = new LinkedBlockingQueue(); - bluetoothBuffer = new LinkedBlockingQueue(); + uartBuffer = new LinkedBlockingQueue<>(); + bluetoothBuffer = new LinkedBlockingQueue<>(); bluetoothService = new BluetoothService(context); - eventHandlers = new CopyOnWriteArrayList(); - dataHandlers = new CopyOnWriteArrayList(); - frameHandlers = new CopyOnWriteArrayList(); - firmwareVersionQueryHandlers = new CopyOnWriteArrayList(); - arduinoLibraryVersionChangeHandlers = new CopyOnWriteArrayList(); + eventHandlers = new CopyOnWriteArrayList<>(); + dataHandlers = new CopyOnWriteArrayList<>(); + frameHandlers = new CopyOnWriteArrayList<>(); + firmwareVersionQueryHandlers = new CopyOnWriteArrayList<>(); + arduinoLibraryVersionChangeHandlers = new CopyOnWriteArrayList<>(); queuedFrames = new ConcurrentLinkedQueue<>(); this.context = context; bluetoothService.addBluetoothServiceHandler(handler); @@ -620,7 +620,7 @@ private void sendFrame(ShieldFrame frame) { // StartSysex, // EndSysex and // Uart_data - ArrayList subArrays = new ArrayList(); + ArrayList subArrays = new ArrayList<>(); for (int i = 0; i < frameBytes.length; i += maxShieldFrameBytes) { byte[] subArray = (i + maxShieldFrameBytes > frameBytes.length) ? ArrayUtils .copyOfRange(frameBytes, i, frameBytes.length) : ArrayUtils diff --git a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/BluetoothService.java b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/BluetoothService.java index 8c5e848fc..202daafc8 100644 --- a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/BluetoothService.java +++ b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/BluetoothService.java @@ -80,7 +80,7 @@ public static interface BluetoothServiceHandler { public BluetoothService(Context context) { mAdapter = BluetoothAdapter.getDefaultAdapter(); mState = STATE_NONE; - this.handlers = new CopyOnWriteArrayList(); + this.handlers = new CopyOnWriteArrayList<>(); } diff --git a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/Jodem.java b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/Jodem.java index 0bda89126..29bf3fbb7 100644 --- a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/Jodem.java +++ b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/Jodem.java @@ -29,7 +29,7 @@ public class Jodem { Thread fileSendingThread; - LinkedBlockingQueue buffer = new LinkedBlockingQueue(); + LinkedBlockingQueue buffer = new LinkedBlockingQueue<>(); public interface JodemEventHandler { public void onError(String error); diff --git a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ShieldFrame.java b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ShieldFrame.java index bb6778600..bdd8d1de4 100644 --- a/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ShieldFrame.java +++ b/oneSheeld/src/main/java/com/integreight/firmatabluetooth/ShieldFrame.java @@ -19,7 +19,7 @@ public ShieldFrame(byte shieldId, byte functionId) { this.shieldId = shieldId; this.functionId = functionId; this.verificationByte = getNewVerificationByte(); - arguments = new ArrayList(); + arguments = new ArrayList<>(); } public ShieldFrame(byte shieldId) { @@ -27,7 +27,7 @@ public ShieldFrame(byte shieldId) { this.shieldId = shieldId; this.functionId = 0; this.verificationByte = getNewVerificationByte(); - arguments = new ArrayList(); + arguments = new ArrayList<>(); } private byte getNewVerificationByte(){ diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/OneSheeldApplication.java b/oneSheeld/src/main/java/com/integreight/onesheeld/OneSheeldApplication.java index 5645b9fbf..4316ac8f6 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/OneSheeldApplication.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/OneSheeldApplication.java @@ -64,8 +64,8 @@ public class OneSheeldApplication extends Application { private final String TASKER_CONDITION_STATUS = "taskerConditionStatus"; private final String CAMERA_CAPTURING = "cameraCapturing"; private final String REMEMBER_SHIELDS = "rememberedShields"; - private Hashtable> runningSheelds = new Hashtable>(); - private final List serviceEventHandlers = new ArrayList(); + private Hashtable> runningSheelds = new Hashtable<>(); + private final List serviceEventHandlers = new ArrayList<>(); private ArduinoFirmata appFirmata; private ConnectionDetector connectionHandler; private ArduinoFirmataEventHandler arduinoFirmataEventHandler; @@ -193,7 +193,7 @@ public void uncaughtException(Thread arg0, final Throwable arg1) { @SuppressLint("UseSparseArrays") public void initTaskerPins() { ArduinoPin[] pins = ArduinoPin.values(); - taskerPinsStatus = new SparseArray(pins.length); + taskerPinsStatus = new SparseArray<>(pins.length); for (ArduinoPin pin : pins) { taskerPinsStatus.put(pin.microHardwarePin, false); } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MediaAudioFilesListAdapter.java b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MediaAudioFilesListAdapter.java index e2ac75974..2ce795e7c 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MediaAudioFilesListAdapter.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MediaAudioFilesListAdapter.java @@ -25,7 +25,7 @@ public class MediaAudioFilesListAdapter extends BaseAdapter { public MediaAudioFilesListAdapter(Activity a, ArrayList items) { this.activity = (MainActivity) a; - this.items = new CopyOnWriteArrayList(); + this.items = new CopyOnWriteArrayList<>(); for (PlaylistItem playlistItem : items) { this.items.add(playlistItem); } @@ -101,7 +101,7 @@ public void addToPlayList() { public void updateList(ArrayList items) { if (items != null) { - this.items = new CopyOnWriteArrayList(); + this.items = new CopyOnWriteArrayList<>(); for (PlaylistItem playlistItem : items) { this.items.add(playlistItem); } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MusicPlayListAdapter.java b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MusicPlayListAdapter.java index 3433db422..80ce359ca 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MusicPlayListAdapter.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/MusicPlayListAdapter.java @@ -25,7 +25,7 @@ public class MusicPlayListAdapter extends BaseAdapter { public MusicPlayListAdapter(Activity a, ArrayList items) { this.activity = (MainActivity) a; - this.items = new CopyOnWriteArrayList(); + this.items = new CopyOnWriteArrayList<>(); for (PlaylistItem playlistItem : items) { this.items.add(playlistItem); } @@ -102,7 +102,7 @@ public void removeFromPlaylist() { public void updateList(ArrayList items) { if (items != null) { - this.items = new CopyOnWriteArrayList(); + this.items = new CopyOnWriteArrayList<>(); for (PlaylistItem playlistItem : items) { this.items.add(playlistItem); } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/SelectedShieldsListAdapter.java b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/SelectedShieldsListAdapter.java index e2d74ffcf..a7364935a 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/SelectedShieldsListAdapter.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/SelectedShieldsListAdapter.java @@ -23,7 +23,7 @@ public class SelectedShieldsListAdapter extends BaseAdapter { public SelectedShieldsListAdapter(Activity a) { this.activity = a; - this.shieldList = new ArrayList(); + this.shieldList = new ArrayList<>(); for (int i = 0; i < AppShields.getInstance().getShieldsArray().size(); i++) { Shield shield = AppShields.getInstance().getShield(i); if (shield.mainActivitySelection) diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/ShieldsListAdapter.java b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/ShieldsListAdapter.java index d86f899a9..87fd6cbd1 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/ShieldsListAdapter.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/adapters/ShieldsListAdapter.java @@ -347,7 +347,7 @@ protected void publishResults(CharSequence arg0, FilterResults arg1) { @Override protected FilterResults performFiltering(CharSequence arg0) { FilterResults results = new FilterResults(); - SparseArray filteredShields = new SparseArray(); + SparseArray filteredShields = new SparseArray<>(); if (arg0 != null) { for (int i = 0; i < AppShields.getInstance() .getShieldsArray().size(); i++) { diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/enums/ArduinoPin.java b/oneSheeld/src/main/java/com/integreight/onesheeld/enums/ArduinoPin.java index e4d7bc1d0..ef3317e17 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/enums/ArduinoPin.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/enums/ArduinoPin.java @@ -136,7 +136,7 @@ public EnumSet getCapabilitySet() { } public static List getDigitalPins() { - List arduinoPins = new ArrayList(); + List arduinoPins = new ArrayList<>(); for (ArduinoPin pin : ArduinoPin.values()) { if (pin.getCapabilitySet().contains(ArduinoPinCapability.INPUT) && pin.getCapabilitySet().contains( diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/enums/UIShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/enums/UIShield.java index 29f972cd2..6495898fc 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/enums/UIShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/enums/UIShield.java @@ -211,7 +211,7 @@ public static void setConnected(boolean isConnected) { public static synchronized List valuesFiltered() { UIShield[] vals = values(); - List valsFiltered = new ArrayList(); + List valsFiltered = new ArrayList<>(); for (int i = 0; i < vals.length; i++) { UIShield cur = vals[i]; if (cur.isReleasable) { @@ -227,7 +227,7 @@ public int compare(UIShield lhs, UIShield rhs) { } }); vals = null; - final ArrayList ret = new ArrayList(); + final ArrayList ret = new ArrayList<>(); for (UIShield uiShield : valsFiltered) { uiShield.itemBackgroundColor = colors[ret.size()]; ret.add(uiShield); diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/model/ApiObjects.java b/oneSheeld/src/main/java/com/integreight/onesheeld/model/ApiObjects.java index 631988094..348d09e8a 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/model/ApiObjects.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/model/ApiObjects.java @@ -13,7 +13,7 @@ public static class ApiObject { private HashMap apiObjects; public ApiObject() { - apiObjects = new HashMap(); + apiObjects = new HashMap<>(); } public void add(String key, String value) { diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ArduinoConnectivityPopup.java b/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ArduinoConnectivityPopup.java index 6e8429e2f..82a3b52f9 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ArduinoConnectivityPopup.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ArduinoConnectivityPopup.java @@ -64,7 +64,7 @@ public ArduinoConnectivityPopup(Activity context) { super(context, android.R.style.Theme_Translucent_NoTitleBar); this.activity = context; scale = activity.getResources().getDisplayMetrics().density; - foundDevicesTable = new Hashtable(); + foundDevicesTable = new Hashtable<>(); thisInstance = this; } @@ -535,7 +535,7 @@ public void onTick(int secondsLeft) { private void scanDevices() { devicesList.removeAllViews(); backPressed = false; - foundDevicesTable = new Hashtable(); + foundDevicesTable = new Hashtable<>(); // Register for broadcasts when a device is discovered initTimeOut(); IntentFilter filter = new IntentFilter(); diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ValidationPopup.java b/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ValidationPopup.java index 5d51f90d6..8dc01e288 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ValidationPopup.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/popup/ValidationPopup.java @@ -24,13 +24,13 @@ public ValidationPopup(MainActivity activity, String title, String msg, ValidationAction... actions) { super(activity, android.R.style.Theme_Translucent_NoTitleBar); this.msg = msg; - this.actions = new ArrayList(Arrays.asList(actions)); + this.actions = new ArrayList<>(Arrays.asList(actions)); this.title = title; this.activity = activity; } public void addValidationAction(ValidationAction action) { - if (this.actions == null) actions = new ArrayList(); + if (this.actions == null) actions = new ArrayList<>(); if (!actions.contains(action)) actions.add(action); } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/ControllerParent.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/ControllerParent.java index 52623e8bd..577db563e 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/ControllerParent.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/ControllerParent.java @@ -40,14 +40,14 @@ public abstract class ControllerParent> { private static final byte SELECT_SHIELD = (byte) 0xFE; private static final byte DESELECT_SHIELD = (byte) 0xFD; public MainActivity activity; - protected List requiredPermissions = new ArrayList(); + protected List requiredPermissions = new ArrayList<>(); // case of FALSE public String[][] requiredPinsNames = new String[][]{ {"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "A0", "A1", "A2", "A3", "A4", "A5"}, {"3", "5", "6", "9", "10", "11"}}; // 2D array for pins types // (Digital and PWM) - public Hashtable matchedShieldPins = new Hashtable(); // saving + public Hashtable matchedShieldPins = new Hashtable<>(); // saving // connected // pins public int requiredPinsIndex = -1;// related to the pins type (index of the @@ -60,7 +60,7 @@ public abstract class ControllerParent> { // like not // found sensors public boolean isInteractive = true;// flag used for the interaction - public List permissions = new ArrayList(); + public List permissions = new ArrayList<>(); // top-right toggle button public boolean cachedArduinoCallbackStatus = false; public Handler actionHandler = new Handler(); // queuing sysex UI calls diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/MusicShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/MusicShield.java index 23f24112e..b4eb77ec0 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/MusicShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/MusicShield.java @@ -18,7 +18,7 @@ public class MusicShield extends ControllerParent { public MediaPlayer mediaPlayer; public String musicFileName = ""; - private ArrayList mediaFiles = new ArrayList(); + private ArrayList mediaFiles = new ArrayList<>(); private int currentIndex = 0; private MusicEventHandler eventHandler; public int mediaDuration = 0; diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/NfcShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/NfcShield.java index a62b9ac23..fd5078d81 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/NfcShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/NfcShield.java @@ -922,8 +922,8 @@ private void sendError(byte errorCode) { sendError(errorCode,false); } private ArrayList> generateArrayListForDisplay() { - ArrayList> parentArrayList = new ArrayList>(); - ArrayList childArrayList = new ArrayList(); + ArrayList> parentArrayList = new ArrayList<>(); + ArrayList childArrayList = new ArrayList<>(); DataReply recordCount = getNdefRecordCount(); if (recordCount.getIntegerData() > 0 && (!recordCount.hasError() || recordCount.getError() == INDEX_OUT_OF_BOUNDS) ) { for (int childCount = 0; childCount < recordCount.getIntegerData(); childCount++) { @@ -957,7 +957,7 @@ private ArrayList> generateArrayListForDisplay() { childArrayList.add("Is Data Parsable: " + "false"); parentArrayList.add(childArrayList); - childArrayList = new ArrayList(); + childArrayList = new ArrayList<>(); } return parentArrayList; }else { diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/SevenSegmentShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/SevenSegmentShield.java index 6ad9e72ad..b01fb0d68 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/SevenSegmentShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/SevenSegmentShield.java @@ -13,7 +13,7 @@ public class SevenSegmentShield extends ControllerParent { private SevenSegmentsEventHandler eventHandler; - public Hashtable pinsStatus = new Hashtable(); + public Hashtable pinsStatus = new Hashtable<>(); public SevenSegmentShield() { super(); diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TerminalShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TerminalShield.java index a8a5ddb29..1e16823a9 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TerminalShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TerminalShield.java @@ -24,7 +24,7 @@ public class TerminalShield extends ControllerParent { public int selectedEnMth = 0; public CopyOnWriteArrayList terminalPrintedLines; public boolean lastItemEndedWithNewLine = true; - public CopyOnWriteArrayList tempLines = new CopyOnWriteArrayList(); + public CopyOnWriteArrayList tempLines = new CopyOnWriteArrayList<>(); public boolean isTimeOn = true, isAutoScrolling = true; public TerminalShield() { @@ -37,7 +37,7 @@ public TerminalShield(Activity activity, String tag) { @Override public ControllerParent init(String tag) { - terminalPrintedLines = new CopyOnWriteArrayList(); + terminalPrintedLines = new CopyOnWriteArrayList<>(); lastItemEndedWithNewLine = true; return super.init(tag); } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TextToSpeechShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TextToSpeechShield.java index cef800c19..00df8ccb4 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TextToSpeechShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TextToSpeechShield.java @@ -105,7 +105,7 @@ private void talkToText() { public void speech(String speechText) { if (myTTS != null) { - HashMap map = new HashMap(); + HashMap map = new HashMap<>(); map.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, activity.getPackageName()); myTTS.speak(speechText, TextToSpeech.QUEUE_FLUSH, // diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TwitterShield.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TwitterShield.java index 83fb6960e..bdab6c514 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TwitterShield.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/TwitterShield.java @@ -102,7 +102,7 @@ public ControllerParent init(String tag) { mSharedPreferences = activity.getApplicationContext() .getSharedPreferences("com.integreight.onesheeld", Context.MODE_PRIVATE); - trackedKeywords = new ArrayList(); + trackedKeywords = new ArrayList<>(); thereIsAConnectionRequest = false; isTwitterStreamConnecting = false; // if(isTwitterLoggedInAlready())initTwitterListening(); @@ -114,7 +114,7 @@ public TwitterShield(Activity activity, String tag) { mSharedPreferences = activity.getApplicationContext() .getSharedPreferences("com.integreight.onesheeld", Context.MODE_PRIVATE); - trackedKeywords = new ArrayList(); + trackedKeywords = new ArrayList<>(); thereIsAConnectionRequest = false; isTwitterStreamConnecting = false; } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/GlcdView.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/GlcdView.java index 77c94b25b..92da6edd9 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/GlcdView.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/GlcdView.java @@ -510,7 +510,7 @@ private int drawChar(char c, float x, float y, int textSize, int textFont, int c for (int widhtAdderCount = 0; widhtAdderCount < c; widhtAdderCount++) { charInit += mfont.chars_width[widhtAdderCount] * 2; } - ArrayList charBytes = new ArrayList(); + ArrayList charBytes = new ArrayList<>(); for (int charBytesCount = 0; charBytesCount < mfont.chars_width[c]; charBytesCount++) { charBytes.add(data[charInit + charBytesCount]); int ha = data[charInit + charBytesCount]; diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/glcd/RadioGroup.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/glcd/RadioGroup.java index 39c04068f..ca61e9524 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/glcd/RadioGroup.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/controller/utils/glcd/RadioGroup.java @@ -10,7 +10,7 @@ public class RadioGroup { int keyCounter = 0; public RadioGroup() { - radios = new SparseArray(); + radios = new SparseArray<>(); } public void add(RadioButton radioButton) { diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/TerminalFragment.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/TerminalFragment.java index f688a4e6a..e8d8d58f7 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/TerminalFragment.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/TerminalFragment.java @@ -100,9 +100,9 @@ public void onClick(View arg0) { ((TerminalShield) getApplication().getRunningShields() .get(getControllerTag())).lastItemEndedWithNewLine = true; ((TerminalShield) getApplication().getRunningShields() - .get(getControllerTag())).tempLines = new CopyOnWriteArrayList(); + .get(getControllerTag())).tempLines = new CopyOnWriteArrayList<>(); ((TerminalShield) getApplication().getRunningShields() - .get(getControllerTag())).terminalPrintedLines = new CopyOnWriteArrayList(); + .get(getControllerTag())).terminalPrintedLines = new CopyOnWriteArrayList<>(); } }); send.setOnClickListener(new View.OnClickListener() { @@ -180,7 +180,7 @@ public void onClick(View vi) { ((TerminalShield) getApplication().getRunningShields() .get(getControllerTag())).selectedEnMth = x; ((TerminalShield) getApplication().getRunningShields() - .get(getControllerTag())).tempLines = new CopyOnWriteArrayList(); + .get(getControllerTag())).tempLines = new CopyOnWriteArrayList<>(); for (TerminalPrintedLine line : ((TerminalShield) getApplication() .getRunningShields().get(getControllerTag())).terminalPrintedLines) { ((TerminalShield) getApplication() diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/sub/MusicShieldSettings_AddFromMedia.java b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/sub/MusicShieldSettings_AddFromMedia.java index d02b7fa9a..84ea11d17 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/sub/MusicShieldSettings_AddFromMedia.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/shields/fragments/sub/MusicShieldSettings_AddFromMedia.java @@ -48,7 +48,7 @@ private void initView() { Cursor imagecursor = getActivity().getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, columns, null, null, orderBy); - ArrayList items = new ArrayList(); + ArrayList items = new ArrayList<>(); for (int i = 0; i < imagecursor.getCount(); i++) { imagecursor.moveToPosition(i); int dataColumnIndex = imagecursor diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/ConnectingPinsView.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/ConnectingPinsView.java index db82c28ea..022c9efb5 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/ConnectingPinsView.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/ConnectingPinsView.java @@ -27,7 +27,7 @@ public class ConnectingPinsView extends Fragment { private static ConnectingPinsView thisInstance; // TextView show; private int selectedPin = 0; - private ArrayList pinsSubContainers = new ArrayList(); + private ArrayList pinsSubContainers = new ArrayList<>(); private View view; private String selectedPinName = ""; MainActivity activity; @@ -84,7 +84,7 @@ public void reset(final ControllerParent controller, } if (activity != null && view != null) { final TextView show = (TextView) view.findViewById(R.id.show); - pinsSubContainers = new ArrayList(); + pinsSubContainers = new ArrayList<>(); selectedPin = 0; selectedPinName = ""; show.setText(""); @@ -186,7 +186,7 @@ public void onPinsDrawn() { } } }); - pinsSubContainers = new ArrayList(); + pinsSubContainers = new ArrayList<>(); LinearLayout pinsContainer = (LinearLayout) view .findViewById(R.id.requiredPinsContainer); pinsContainer.removeAllViews(); diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/ComboSeekBar.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/ComboSeekBar.java index 83b0b3e0b..c61edb27e 100755 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/ComboSeekBar.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/ComboSeekBar.java @@ -21,7 +21,7 @@ public class ComboSeekBar extends SeekBar { private CustomThumbDrawable mThumb; - private List mDots = new ArrayList(); + private List mDots = new ArrayList<>(); private OnItemClickListener mItemClickListener; private Dot prevSelected = null; private boolean isSelected = false; diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/LockPatternViewEx.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/LockPatternViewEx.java index 104a4f52d..481444ee7 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/LockPatternViewEx.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/LockPatternViewEx.java @@ -89,7 +89,7 @@ public class LockPatternViewEx extends View { private static final float DRAG_THRESHHOLD = 0.0f; private OnPatternListener mOnPatternListener; - private ArrayList mPattern = new ArrayList(9); + private ArrayList mPattern = new ArrayList<>(9); /** * Lookup table for the circles of the pattern we are currently drawing. diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MultiTouchContainer.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MultiTouchContainer.java index 1352e9bb3..1fa335b36 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MultiTouchContainer.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MultiTouchContainer.java @@ -12,7 +12,7 @@ public class MultiTouchContainer extends RelativeLayout { public int currentIndex = -1; public String currentTag = null; - private ArrayList childrenRects = new ArrayList(); + private ArrayList childrenRects = new ArrayList<>(); public MultiTouchContainer(Context context, AttributeSet attrs) { super(context, attrs); diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MutitouchKeysContainer.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MutitouchKeysContainer.java index f530c5b92..632832634 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MutitouchKeysContainer.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/MutitouchKeysContainer.java @@ -13,8 +13,8 @@ public class MutitouchKeysContainer extends RelativeLayout { public int currentIndex = -1; public String currentTag = null; - private CopyOnWriteArrayList childrenRects = new CopyOnWriteArrayList(); - private CopyOnWriteArrayList pressedRects = new CopyOnWriteArrayList(); + private CopyOnWriteArrayList childrenRects = new CopyOnWriteArrayList<>(); + private CopyOnWriteArrayList pressedRects = new CopyOnWriteArrayList<>(); private int maxPointers = 1; public MutitouchKeysContainer(Context context, AttributeSet attrs) { diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PinsColumnContainer.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PinsColumnContainer.java index fec759931..5d8422f25 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PinsColumnContainer.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PinsColumnContainer.java @@ -26,7 +26,7 @@ public class PinsColumnContainer extends RelativeLayout { public String currentTag = null; private OnChildFocusListener focusListener; private int extraHorizontalSpace = 0, extraVerticalSpace = 0; - private ArrayList childrenRects = new ArrayList(); + private ArrayList childrenRects = new ArrayList<>(); ImageView cursor; RelativeLayout.LayoutParams cursorParams; ControllerParent controller; @@ -50,7 +50,7 @@ public void setup(OnChildFocusListener focusListener, ImageView cursor, currentIndex = -1; currentTag = null; isOnglobalCalled = false; - childrenRects = new ArrayList(); + childrenRects = new ArrayList<>(); getViewTreeObserver().addOnGlobalLayoutListener( new OnGlobalLayoutListener() { @@ -59,7 +59,7 @@ public void onGlobalLayout() { if (!isOnglobalCalled && (childrenRects == null || childrenRects .size() == 0)) { - childrenRects = new ArrayList(); + childrenRects = new ArrayList<>(); loadRects(PinsColumnContainer.this); PinsColumnContainer.this.onGetPinsListener .onPinsDrawn(); @@ -203,7 +203,7 @@ public boolean onTouchEvent(MotionEvent event) { cursor.setVisibility(View.INVISIBLE); if (focusListener != null) focusListener.selectThisChild(currentIndex, currentIndex == -1 ? "" : currentTag); - childrenRects = new ArrayList(); + childrenRects = new ArrayList<>(); loadRects(this); return true; } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PluginPinsColumnContainer.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PluginPinsColumnContainer.java index e3b2c2188..fee9cf476 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PluginPinsColumnContainer.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/PluginPinsColumnContainer.java @@ -23,7 +23,7 @@ public class PluginPinsColumnContainer extends RelativeLayout { public String currentTag = null; private OnChildFocusListener focusListener; private int extraHorizontalSpace = 0, extraVerticalSpace = 0; - private ArrayList childrenRects = new ArrayList(); + private ArrayList childrenRects = new ArrayList<>(); ImageView cursor; RelativeLayout.LayoutParams cursorParams; private onGetPinsView onGetPinsListener; @@ -45,7 +45,7 @@ public void setup(OnChildFocusListener focusListener, ImageView cursor, this.currentIndex = -1; currentTag = null; isOnglobalCalled = false; - childrenRects = new ArrayList(); + childrenRects = new ArrayList<>(); getViewTreeObserver().addOnGlobalLayoutListener( new OnGlobalLayoutListener() { @@ -54,7 +54,7 @@ public void onGlobalLayout() { if (!isOnglobalCalled && (childrenRects == null || childrenRects .size() == 0)) { - childrenRects = new ArrayList(); + childrenRects = new ArrayList<>(); loadRects(PluginPinsColumnContainer.this); PluginPinsColumnContainer.this.onGetPinsListener .onPinsDrawn(); @@ -189,7 +189,7 @@ public boolean onTouchEvent(MotionEvent event) { cursor.setVisibility(View.INVISIBLE); focusListener.selectThisChild(currentIndex, currentIndex == -1 ? "" : currentTag); - childrenRects = new ArrayList(); + childrenRects = new ArrayList<>(); loadRects(this); return true; } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/utils/Lists.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/utils/Lists.java index 1996b90ad..62eeffd9f 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/utils/Lists.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/customviews/utils/Lists.java @@ -35,7 +35,7 @@ public class Lists { * @return a newly-created, initially-empty {@code ArrayList} */ public static ArrayList newArrayList() { - return new ArrayList(); + return new ArrayList<>(); } /** @@ -63,7 +63,7 @@ public static ArrayList newArrayList() { */ public static ArrayList newArrayList(E... elements) { int capacity = (elements.length * 110) / 100 + 5; - ArrayList list = new ArrayList(capacity); + ArrayList list = new ArrayList<>(capacity); Collections.addAll(list, elements); return list; } diff --git a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/database/MusicPlaylist.java b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/database/MusicPlaylist.java index d1043bd81..02fe8f783 100644 --- a/oneSheeld/src/main/java/com/integreight/onesheeld/utils/database/MusicPlaylist.java +++ b/oneSheeld/src/main/java/com/integreight/onesheeld/utils/database/MusicPlaylist.java @@ -68,7 +68,7 @@ public int delete(int id) { } public ArrayList getPlaylist() { - ArrayList topics = new ArrayList(); + ArrayList topics = new ArrayList<>(); String[] columns = new String[]{KEY_ID, PATH, NAME}; Cursor cursor = sqLiteDatabase.query(MYDATABASE_TABLE, columns, null, null, null, null, null); diff --git a/pagerIndicator/src/main/java/com/viewpagerindicator/TitlePageIndicator.java b/pagerIndicator/src/main/java/com/viewpagerindicator/TitlePageIndicator.java index f155d830a..b20f79fe9 100644 --- a/pagerIndicator/src/main/java/com/viewpagerindicator/TitlePageIndicator.java +++ b/pagerIndicator/src/main/java/com/viewpagerindicator/TitlePageIndicator.java @@ -669,7 +669,7 @@ private void clipViewOnTheLeft(Rect curViewBound, float curViewWidth, int left) * @return */ private ArrayList calculateAllBounds(Paint paint) { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); //For each views (If no values then add a fake one) final int count = mViewPager.getAdapter().getCount(); final int width = getWidth(); diff --git a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/PullToRefreshConfigXmlParser.java b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/PullToRefreshConfigXmlParser.java index 55eb6ba6d..c8577beaa 100644 --- a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/PullToRefreshConfigXmlParser.java +++ b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/PullToRefreshConfigXmlParser.java @@ -91,10 +91,10 @@ protected PullToRefreshNode getResult() { * */ private static class PullToRefreshResult { - public final Map loadingLayoutClazzNameMap = new HashMap(); - public final Map indicatorLayoutClazzNameMap = new HashMap(); - public final Map googleStyleViewLayoutClazzNameMap = new HashMap(); - public final Map googleStyleProgressLayoutClazzNameMap = new HashMap(); + public final Map loadingLayoutClazzNameMap = new HashMap<>(); + public final Map indicatorLayoutClazzNameMap = new HashMap<>(); + public final Map googleStyleViewLayoutClazzNameMap = new HashMap<>(); + public final Map googleStyleProgressLayoutClazzNameMap = new HashMap<>(); } /** diff --git a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/XmlPullNode.java b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/XmlPullNode.java index 3cdf3623c..bbac8bcf9 100644 --- a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/XmlPullNode.java +++ b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/configuration/xml/XmlPullNode.java @@ -42,7 +42,7 @@ class XmlPullNode { * Map which store children
* child's node name can have upper case or lower. all is the same whether that is upper or lower. */ - private final Map children = new TreeMap( + private final Map children = new TreeMap<>( String.CASE_INSENSITIVE_ORDER); /** * Current node's name diff --git a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/LoadingLayoutProxy.java b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/LoadingLayoutProxy.java index 4542d6179..7e74bbe80 100644 --- a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/LoadingLayoutProxy.java +++ b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/LoadingLayoutProxy.java @@ -28,7 +28,7 @@ public class LoadingLayoutProxy implements ILoadingLayout { private final HashSet mLoadingLayouts; LoadingLayoutProxy() { - mLoadingLayouts = new HashSet(); + mLoadingLayouts = new HashSet<>(); } /** diff --git a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/extras/SoundPullEventListener.java b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/extras/SoundPullEventListener.java index bc8b10c55..fdb924def 100644 --- a/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/extras/SoundPullEventListener.java +++ b/pullToRefreshlibrary/src/main/java/com/handmark/pulltorefresh/library/extras/SoundPullEventListener.java @@ -40,7 +40,7 @@ public class SoundPullEventListener implements PullToRefreshBase */ public SoundPullEventListener(Context context) { mContext = context; - mSoundMap = new HashMap(); + mSoundMap = new HashMap<>(); } @Override