From ab36f4e7488358dea4ab6b54ee2b7bef3da0232b Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Tue, 20 Dec 2011 20:20:24 -0800 Subject: Update SDK codebase to JDK 6 This changeset makes the SDK codebase compile with source=1.6 (which means it also requires JDK 6). This means that methods implementing an interface requires @Override's. It also means we can start using APIs like the ArrayDeque class and methods like String#isEmpty(). This changeset looks big but the change is trivial: it's basically adding @Override in all the places that need it, along with some other automatic Eclipse cleanup in certain files (such as reordering imports where they were incorrectly ordered (because older versions of Eclipse didn't always handle inner classes right)), as well as cleaning up trailing whitespace and removing some $NON-NLS-1$ markers on lines where there aren't any string literals anymore. This changeset also sets the source and target JDK level to 6 in the Eclipse compiler .settings file, and synchronizes this file to all the other Eclipse SDK projects. Change-Id: I6a9585aa44c3dee9a5c00739ab22fbdbcb9f8275 --- .../src/com/android/ide/common/rendering/api/AdapterBinding.java | 1 + .../src/com/android/ide/common/rendering/api/DataBindingItem.java | 1 + .../com/android/ide/common/rendering/api/DensityBasedResourceValue.java | 1 + .../src/com/android/ide/common/rendering/api/ResourceValue.java | 2 ++ .../src/com/android/ide/common/rendering/api/StyleResourceValue.java | 2 ++ 5 files changed, 7 insertions(+) (limited to 'layoutlib_api/src') diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java b/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java index 9481246..ddcdbd5 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java @@ -75,6 +75,7 @@ public class AdapterBinding implements Iterable { return mFooters.get(index); } + @Override public Iterator iterator() { return mItems.iterator(); } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java index 93569bd..2a93f15 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java @@ -89,6 +89,7 @@ public class DataBindingItem implements Iterable { return Collections.emptyList(); } + @Override public Iterator iterator() { List list = getChildren(); return list.iterator(); diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java index f63f16f..5add715 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java @@ -41,6 +41,7 @@ public class DensityBasedResourceValue extends ResourceValue implements IDensity /** Legacy method, do not call * @deprecated use {@link #getResourceDensity()} instead. */ + @Override @Deprecated public Density getDensity() { return Density.getEnum(mDensity.getDpiValue()); diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java index bb7dab4..dceb7c5 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java @@ -46,6 +46,7 @@ public class ResourceValue extends ResourceReference implements IResourceValue { * Returns the type of the resource. For instance "drawable", "color", etc... * @deprecated use {@link #getResourceType()} instead. */ + @Override @Deprecated public String getType() { return mType.getName(); @@ -54,6 +55,7 @@ public class ResourceValue extends ResourceReference implements IResourceValue { /** * Returns the value of the resource, as defined in the XML. This can be null */ + @Override public final String getValue() { return mValue; } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java index 9d1e65d..2daa7f9 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java @@ -44,6 +44,7 @@ public final class StyleResourceValue extends ResourceValue implements IStyleRes /** * Returns the parent style name or null if unknown. */ + @Override public String getParentStyle() { return mParentStyle; } @@ -75,6 +76,7 @@ public final class StyleResourceValue extends ResourceValue implements IStyleRes * Legacy method. * @deprecated use {@link #getValue()} */ + @Override @Deprecated public IResourceValue findItem(String name) { return mItems.get(name); -- cgit v1.1