From 65eb16770153f1751c353713b7b4a355470954ad Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Thu, 17 Jul 2014 19:20:35 +0200 Subject: switch to Java 1.7 At least since march both ADT and Android Studio support Java 7 features in Android development. Let's use them. --- cgeo-contacts/.settings/org.eclipse.jdt.core.prefs | 7 ++++--- cgeo-contacts/src/cgeo/contacts/ContactsActivity.java | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'cgeo-contacts') diff --git a/cgeo-contacts/.settings/org.eclipse.jdt.core.prefs b/cgeo-contacts/.settings/org.eclipse.jdt.core.prefs index e08a777..90a6f5b 100644 --- a/cgeo-contacts/.settings/org.eclipse.jdt.core.prefs +++ b/cgeo-contacts/.settings/org.eclipse.jdt.core.prefs @@ -6,9 +6,10 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -96,7 +97,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java b/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java index 098f5b9..bbda493 100644 --- a/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java +++ b/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java @@ -73,7 +73,7 @@ public final class ContactsActivity extends Activity { } private void selectContact(final List> contacts) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (Pair p : contacts) { list.add(p.second); } @@ -105,13 +105,13 @@ public final class ContactsActivity extends Activity { final String[] selectionArgs = new String[] { like ? "%" + searchName + "%" : searchName }; Cursor cursor = null; - List> result = new ArrayList>(); + List> result = new ArrayList<>(); try { cursor = getContentResolver().query(uri, projection, selection, selectionArgs, null); while (cursor != null && cursor.moveToNext()) { int foundId = cursor.getInt(0); String foundName = cursor.getString(1); - result.add(new Pair(foundId, foundName)); + result.add(new Pair<>(foundId, foundName)); } } catch (Exception e) { Log.e(LOG_TAG, "ContactsActivity.getContactId", e); -- cgit v1.1