aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/research
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/research')
-rw-r--r--java/src/com/android/inputmethod/research/FixedLogBuffer.java2
-rw-r--r--java/src/com/android/inputmethod/research/LogBuffer.java2
-rw-r--r--java/src/com/android/inputmethod/research/LogUnit.java12
-rw-r--r--java/src/com/android/inputmethod/research/MotionEventReader.java14
4 files changed, 14 insertions, 16 deletions
diff --git a/java/src/com/android/inputmethod/research/FixedLogBuffer.java b/java/src/com/android/inputmethod/research/FixedLogBuffer.java
index 8b64de8ae..210015643 100644
--- a/java/src/com/android/inputmethod/research/FixedLogBuffer.java
+++ b/java/src/com/android/inputmethod/research/FixedLogBuffer.java
@@ -163,7 +163,7 @@ public class FixedLogBuffer extends LogBuffer {
// Allocate space for n*2 logUnits. There will be at least n, one for each word, and
// there may be additional for punctuation, between-word commands, etc. This should be
// enough that reallocation won't be necessary.
- final ArrayList<LogUnit> resultList = new ArrayList<LogUnit>(n * 2);
+ final ArrayList<LogUnit> resultList = new ArrayList<>(n * 2);
for (final LogUnit logUnit : logUnits) {
n -= logUnit.getNumWords();
if (n < 0) break;
diff --git a/java/src/com/android/inputmethod/research/LogBuffer.java b/java/src/com/android/inputmethod/research/LogBuffer.java
index b07b761f0..0d9c357da 100644
--- a/java/src/com/android/inputmethod/research/LogBuffer.java
+++ b/java/src/com/android/inputmethod/research/LogBuffer.java
@@ -31,7 +31,7 @@ public class LogBuffer {
private final LinkedList<LogUnit> mLogUnits;
public LogBuffer() {
- mLogUnits = new LinkedList<LogUnit>();
+ mLogUnits = new LinkedList<>();
}
protected LinkedList<LogUnit> getLogUnits() {
diff --git a/java/src/com/android/inputmethod/research/LogUnit.java b/java/src/com/android/inputmethod/research/LogUnit.java
index 3366df12a..1750751a7 100644
--- a/java/src/com/android/inputmethod/research/LogUnit.java
+++ b/java/src/com/android/inputmethod/research/LogUnit.java
@@ -93,9 +93,9 @@ public class LogUnit {
private SuggestedWords mSuggestedWords;
public LogUnit() {
- mLogStatementList = new ArrayList<LogStatement>();
- mValuesList = new ArrayList<Object[]>();
- mTimeList = new ArrayList<Long>();
+ mLogStatementList = new ArrayList<>();
+ mValuesList = new ArrayList<>();
+ mTimeList = new ArrayList<>();
mIsPartOfMegaword = false;
mCorrectionType = CORRECTIONTYPE_NO_CORRECTION;
mSuggestedWords = null;
@@ -311,9 +311,9 @@ public class LogUnit {
// Create the LogUnit containing the later logStatements and associated data.
final LogUnit newLogUnit = new LogUnit(
- new ArrayList<LogStatement>(laterLogStatements),
- new ArrayList<Object[]>(laterValues),
- new ArrayList<Long>(laterTimes),
+ new ArrayList<>(laterLogStatements),
+ new ArrayList<>(laterValues),
+ new ArrayList<>(laterTimes),
true /* isPartOfMegaword */);
newLogUnit.mWords = null;
newLogUnit.mMayContainDigit = mMayContainDigit;
diff --git a/java/src/com/android/inputmethod/research/MotionEventReader.java b/java/src/com/android/inputmethod/research/MotionEventReader.java
index 3388645b7..f6b7352e7 100644
--- a/java/src/com/android/inputmethod/research/MotionEventReader.java
+++ b/java/src/com/android/inputmethod/research/MotionEventReader.java
@@ -67,11 +67,10 @@ public class MotionEventReader {
@UsedForTesting
static class ReplayData {
- final ArrayList<Integer> mActions = new ArrayList<Integer>();
- final ArrayList<PointerProperties[]> mPointerPropertiesArrays
- = new ArrayList<PointerProperties[]>();
- final ArrayList<PointerCoords[]> mPointerCoordsArrays = new ArrayList<PointerCoords[]>();
- final ArrayList<Long> mTimes = new ArrayList<Long>();
+ final ArrayList<Integer> mActions = new ArrayList<>();
+ final ArrayList<PointerProperties[]> mPointerPropertiesArrays = new ArrayList<>();
+ final ArrayList<PointerCoords[]> mPointerCoordsArrays = new ArrayList<>();
+ final ArrayList<Long> mTimes = new ArrayList<>();
}
/**
@@ -228,8 +227,7 @@ public class MotionEventReader {
private PointerProperties[] readPointerProperties(final JsonReader jsonReader)
throws IOException {
- final ArrayList<PointerProperties> pointerPropertiesArrayList =
- new ArrayList<PointerProperties>();
+ final ArrayList<PointerProperties> pointerPropertiesArrayList = new ArrayList<>();
jsonReader.beginArray();
while (jsonReader.hasNext()) {
final PointerProperties pointerProperties = new PointerProperties();
@@ -254,7 +252,7 @@ public class MotionEventReader {
jsonReader.beginArray();
while (jsonReader.hasNext()) { // Array of historical data
jsonReader.beginObject();
- final ArrayList<PointerCoords> pointerCoordsArrayList = new ArrayList<PointerCoords>();
+ final ArrayList<PointerCoords> pointerCoordsArrayList = new ArrayList<>();
while (jsonReader.hasNext()) { // Time/data object
final String name = jsonReader.nextName();
if (name.equals("t")) {